[MacPorts] #36026: ld64 sometimes builds wrong which causes other software to fail to build
MacPorts
noreply at macports.org
Sun Sep 30 12:20:10 PDT 2012
#36026: ld64 sometimes builds wrong which causes other software to fail to build
-------------------------+------------------------
Reporter: jwhowse4@… | Owner: jeremyhu@…
Type: defect | Status: new
Priority: Normal | Milestone:
Component: ports | Version: 2.1.2
Resolution: | Keywords:
Port: ld64 |
-------------------------+------------------------
Comment (by jeremyhu@…):
Replying to [comment:94 vaccari@…]:
> I can well be mistaken, as I'm no expert here, but I thought the output
of command
>
> {{{
> sudo clang -E .... -o _muldi3_s.o ...
> }}}
Right, but we don't care about muldi3_s.o. It's not part of ld64. You're
just seeing it in your error messages because ld is trying to link that
file, but ld is the problem, not muldi3_s.o.
Replying to [comment:95 vaccari@…]:
> So, I'm now trying to produce the preprocessed code for
macho_relocatable_file.cpp
>
> Found it in
>
> {{{
>
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_ld64/ld64/work/ld64-133.3/src/ld/parsers
> }}}
>
> cd there and tried
>
> {{{
> sudo clang -E -I. -I../../ld -I../../abstraction
macho_relocatable_file.cpp -o macho_relocatable_file.cpp.preprocessed
> }}}
>
> But got error
>
>
> {{{
> In file included from macho_relocatable_file.cpp:35:
> ../../abstraction/MachOFileAbstraction.hpp:290:10: fatal error:
> 'mach-o/arm/reloc.h' file not found
> #include <mach-o/arm/reloc.h>
> }}}
>
> I can only guess some needed configuration is missing when trying
''clang -E'' straight from the command line.
>
> I'm willing to help here, but don't want to waste your time either,
given I'm quite ignorant on this matter...
Look at the build log for ld64 and just replace the '-c -o <output file>'
with '-E -o <where you want to store the preprocessed source>' ... Please
don't try to figure out a build line on your own because there is
something *very particular* going on here, and you need to present me with
the exact preprocessed source, not just *any* preprocessed source.
In my log, I see:
{{{
/usr/bin/clang++ -Os -O2 -arch x86_64
-I/opt/local/libexec/llvm-3.1/include -DLTO_SUPPORT -Isrc/abstraction
-Isrc/ld -Isrc/ld/parsers -I/opt/local/include -c -o
src/ld/parsers/macho_relocatable_file.o
src/ld/parsers/macho_relocatable_file.cpp
}}}
So I would do:
{{{
/usr/bin/clang++ -Os -O2 -arch x86_64
-I/opt/local/libexec/llvm-3.1/include -DLTO_SUPPORT -Isrc/abstraction
-Isrc/ld -Isrc/ld/parsers -I/opt/local/include -E -o
~/Desktop/macho_relocatable_file.preprocessed.cpp
src/ld/parsers/macho_relocatable_file.cpp
}}}
--
Ticket URL: <https://trac.macports.org/ticket/36026#comment:96>
MacPorts <http://www.macports.org/>
Ports system for Mac OS
More information about the macports-tickets
mailing list