Opened 18 months ago

Closed 18 months ago

Last modified 18 months ago

#66176 closed defect (duplicate)

lzma +universal fails to build: Undefined symbols for architecture i386: "_main", referenced from:

Reported by: barracuda156 Owned by: ryandesign (Ryan Carsten Schmidt)
Priority: Normal Milestone:
Component: ports Version: 2.8.0
Keywords: Cc:
Port: lzma

Description

Fails on 10.8.5:

ld: warning: ignoring file _o/LzmaAlone.o, file was built for unsupported file format ( 0xCF 0xFA 0xED 0xFE 0x07 0x00 0x00 0x01 0x03 0x00 0x00 0x00 0x01 0x00 0x00 0x00 ) which is not the architecture being linked (i386): _o/LzmaAlone.old: warning: ignoring file _o/ConsoleClose.o, file was built for unsupported file format ( 0xCF 0xFA 0xED 0xFE 0x07 0x00 0x00 0x01 0x03 0x00 0x00 0x00 0x01 0x00 0x00 0x00 ) which is not the architecture being linked (i386): _o/ConsoleClose.o
ignoring file _o/Bench.o, file was built for unsupported file format ( 0xCF 0xFA 0xED 0xFE 0x07 0x00 0x00 0x01 0x03 0x00 0x00 0x00 0x01 0x00 0x00 0x00 ) which is not the architecture being linked (i386): _o/Bench.o

Undefined symbols for architecture i386:
  "_main", referenced from:
     implicit entry/start for main executable
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
gnumake: *** [_o/lzma] Error 1

Similar failure on Rosetta:

ld: warning: in _o/LzmaAlone.o, file was built for unsupported file format which is not the architecture being linked (ppc)
ld: warning: in _o/Bench.o, file was built for unsupported file format which is not the architecture being linked (ppc)
Undefined symbols:
  "_main", referenced from:
      start in crt1.10.5.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
gnumake: *** [_o/lzma] Error 1

Attachments (2)

10.8.5_universal.log (75.8 KB) - added by barracuda156 18 months ago.
10.6.8_Rosetta.log (135.0 KB) - added by barracuda156 18 months ago.

Download all attachments as: .zip

Change History (6)

Changed 18 months ago by barracuda156

Attachment: 10.8.5_universal.log added

Changed 18 months ago by barracuda156

Attachment: 10.6.8_Rosetta.log added

comment:1 Changed 18 months ago by barracuda156

Then for x86_64 (non-universal) on 10.8.5 it is broken:

--->  Cleaning lzma
--->  Removing work directory for lzma
--->  Scanning binaries for linking errors
--->  No broken files found.
lzma is using libstdc++ (this installation is configured to use libc++)
Error: Port lzma is still broken (cxx_stdlib mismatch) after rebuilding it more than 3 times.
Error: Please run port -d -y rev-upgrade and use the output to report a bug.
Error: rev-upgrade failed: Port lzma still broken after rebuilding 3 times
Error: Follow https://guide.macports.org/#project.tickets if you believe there
is a bug.

Macports have standard config, C++ is not manually set. Default compilers being used.

Last edited 18 months ago by barracuda156 (previous) (diff)

comment:2 Changed 18 months ago by kencu (Ken)

for both of these issues, likely the same problem.

MacPorts sets up the proper environment and flags:

209	:debug:build CFLAGS='-Os -arch x86_64 -arch i386'
210	:debug:build CPATH='/opt/local/include'
211	:debug:build CPLUS_INCLUDE_PATH='/opt/local/include/LegacySupport'
212	:debug:build CPPFLAGS='-isystem/opt/local/include/LegacySupport -I/opt/local/include'
213	:debug:build CXX='/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_archivers_lzma/lzma/work/compwrap/cxx/usr/bin/clang++'
214	:debug:build CXXFLAGS='-Os -arch x86_64 -arch i386 -stdlib=libc++'

but this build doesn't use any of them, it appears.

usr/bin/clang     -O2 -c -Wall -Wextra  -DNDEBUG -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fPIC  -o _o/7zCrc.o ../../../../C/7zCrc.c

/usr/bin/clang++     -O2 -c -Wall -Wextra  -DNDEBUG -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fPIC   -o _o/FileDir.o  ../../../Windows/FileDir.cpp

so anything non-standard (ie where the default build from the compiler is not doing what we want) will fail.

comment:3 Changed 18 months ago by kencu (Ken)

Resolution: duplicate
Status: assignedclosed

and that issue is: ticket:65908, which you are already copied on.

comment:4 in reply to:  3 Changed 18 months ago by barracuda156

Replying to kencu:

and that issue is: ticket:65908, which you are already copied on.

A-ha, thanks.

Note: See TracTickets for help on using tickets.