Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#34110 closed defect (fixed)

cctools compilation error: mach-o/prune_trie.h not found

Reported by: michelle.lynn.gill@… Owned by: mfeiri
Priority: Normal Milestone:
Component: ports Version: 2.0.4
Keywords: Cc: jeremyhu (Jeremy Huddleston Sequoia), macports@…, kwasir@…
Port: cctools

Description

While compiling cctools, which was recently added as a gcc-4* dependency (gcc-44 and gcc-45, in my case), I encountered the following error:

:info:build /usr/bin/clang -Os -DLTO_SUPPORT -DTRIE_SUPPORT -g -Wall -Wno-format-nonliteral -I. -I./../include -I.  -arch x86_64 -I/Volumes/Files/macports/libexec/llvm-3.0/include  -DNDEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -O3  -g -fno-common -c -o ./strip.o strip.c
:info:build strip.c:50:10: fatal error: 'mach-o/prune_trie.h' file not found
:info:build #include <mach-o/prune_trie.h>
:info:build          ^
:info:build 1 error generated.
:info:build make[1]: *** [strip.o] Error 1
:info:build make[1]: *** Waiting for unfinished jobs....
:info:build 1 warning generated.
:info:build make[1]: Leaving directory `/Volumes/Files/macports/var/macports/build/_Volumes_Files_macports_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_cctools/cctools/work/cctools-822/misc'
:info:build make: *** [all] Error 1
:info:build make: Leaving directory `/Volumes/Files/macports/var/macports/build/_Volumes_Files_macports_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_cctools/cctools/work/cctools-822'
:info:build shell command " cd "/Volumes/Files/macports/var/macports/build/_Volumes_Files_macports_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_cctools/cctools/work/cctools-822" && /usr/bin/make -j4 -w all RC_OS="macos" USE_DEPENDENCY_FILE=NO BUILD_DYLIBS=NO LTO=-DLTO_SUPPORT CC="/usr/bin/clang" CXX="/usr/bin/clang++" RC_CFLAGS="-arch x86_64 `llvm-config-mp-3.0 --cflags`" LLVM_MC="llvm-mc-mp-3.0" TRIE=-DTRIE_SUPPORT " returned error 2
:error:build Target org.macports.build returned: shell command failed (see log for details)
:debug:build Backtrace: shell command failed (see log for details)
    while executing
"command_exec build"
    (procedure "portbuild::build_main" line 8)
    invoked from within
"$procedure $targetname"
:info:build Warning: the following items did not execute (for cctools): org.macports.activate org.macports.build org.macports.destroot org.macports.install
:notice:build Log for cctools is at: /Volumes/Files/macports/var/macports/logs/_Volumes_Files_macports_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_cctools/cctools/main.log

From a brief search, it seems this file is provided by the ld64 port, which compiled successfully immediately before the cctools compilation, thus I believe the error is in cctools.

I'm using MacPorts 2.0.4, Mac OS X 10.7.3, and XCode 4.2.1. I realize this isn't the latest version of XCode. I have been waiting to update, as I've noticed a lot of discussion about newer versions on the mailing list. Happy to update if this will fix the issue, though.

Attachments (1)

main.log (270.5 KB) - added by michelle.lynn.gill@… 13 years ago.

Download all attachments as: .zip

Change History (23)

Changed 13 years ago by michelle.lynn.gill@…

Attachment: main.log added

comment:1 Changed 13 years ago by michelle.lynn.gill@…

Cc: michelle.lynn.gill@… added

Cc Me!

comment:2 Changed 13 years ago by macports@…

I have the same problem with a similar system configuration.

My system: Mac OS X 10.7.3 MacPorts 2.0.4 XCode 4.2.1

comment:3 Changed 13 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: jeremyhu@… macports@… added; mfeiri jeremyhu michelle.lynn.gill@… removed
Keywords: devel removed
Owner: changed from macports-tickets@… to mfeiri@…

comment:4 Changed 13 years ago by kwasir@…

Cc: kwasir@… added

Cc Me!

comment:5 Changed 13 years ago by mf2k (Frank Schima)

There is no reason not to update Xcode to the latest version. I recommend uninstalling the old version first and then installing version 4.3.2 from the app store.

From your home directory type:

sudo /Developer/Library/uninstall-devtools --mode=all

After installing Xcode 4.3.2, run the following:

sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer

You should then rebuild python and perl if you have them installed.

comment:6 Changed 13 years ago by jowens@…

I've got the same error and I'm using XCode 4.3.2.

comment:7 in reply to:  6 Changed 13 years ago by jowens@…

Replying to jowens@…:

I've got the same error and I'm using XCode 4.3.2.

Not positive, but it doesn't look like the build command is including /opt/local/include.

/usr/bin/clang -Os -DLTO_SUPPORT -DTRIE_SUPPORT -g -Wall -Wno-format-nonliteral -I. -I./../include -I.  -arch x86_64 -I/opt/local/libexec/llvm-3.0/include  -DNDEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -O3  -g -fno-common -c -o ./strip.o strip.c
./strip.c:50:10: fatal error: 'mach-o/prune_trie.h' file not found

comment:8 Changed 13 years ago by jeremyhu (Jeremy Huddleston Sequoia)

The file should be provided by the ld64 port:

$ port contents ld64
Port ld64 contains:
  /opt/local/bin/ObjectDump
  /opt/local/bin/dyldinfo
  /opt/local/bin/ld
  /opt/local/bin/machocheck
  /opt/local/bin/rebase
  /opt/local/bin/unwinddump
  /opt/local/include/mach-o/prune_trie.h
  /opt/local/lib/libprunetrie.a
  /opt/local/libexec/ld64/ld
  /opt/local/share/man/man1/dyldinfo.1.gz
  /opt/local/share/man/man1/ld.1.gz
  /opt/local/share/man/man1/rebase.1.gz
  /opt/local/share/man/man1/unwinddump.1.gz

FWIW, I built all the gccs on Tiger, Leopard, SL, Lion, and Mountain Lion (except gcc42 was Tiger only, and gcc45 didn't build on Tiger for unrelated reasons).

comment:9 Changed 13 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Of course I also have it at /usr/local/include/mach-o/prune_trie.h because of my internal bits, so that's probably where my builds were finding it. I'm surprised nobody noticed this before. It looks like cctools needs to be updated to include a missing -I${prefix}/include

comment:10 in reply to:  9 Changed 13 years ago by michelle.lynn.gill@…

Replying to jeremyhu@…:

Of course I also have it at /usr/local/include/mach-o/prune_trie.h because of my internal bits, so that's probably where my builds were finding it. I'm surprised nobody noticed this before. It looks like cctools needs to be updated to include a missing -I${prefix}/include

This is the error I suspected. I did verify that the file was installed in $PORTHOME/include/mach-o/prune_trie.h at the time of the error. It may also be worth noting that my Macports install is not in /opt/local.

comment:11 Changed 13 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Resolution: fixed
Status: newclosed

comment:12 Changed 13 years ago by jowens@…

Is that going to fix the error? There's no /Developer include in the command that fails.

/usr/bin/clang -Os -DLTO_SUPPORT -DTRIE_SUPPORT -g -Wall -Wno-format-nonliteral -I. -I./../include -I.  -arch x86_64 -I/opt/local/libexec/llvm-3.0/include  -DNDEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -O3  -g -fno-common -c -o ./strip.o strip.c

comment:13 Changed 13 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Resolution: fixed
Status: closedreopened

Weird, I saw an -I/Developer/${prefix}/include when I ran it...

Can you please test it...

comment:14 in reply to:  13 Changed 13 years ago by michelle.lynn.gill@…

Replying to jeremyhu@…:

Weird, I saw an -I/Developer/${prefix}/include when I ran it...

Can you please test it...

I just updated MacPorts (and verified that the cctools Portfile contains the patch in r92106) and then tried to clean and install cctools. I get the same error that I posted above.

comment:15 in reply to:  12 Changed 13 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Replying to jowens@…:

Is that going to fix the error? There's no /Developer include in the command that fails.

/usr/bin/clang -Os -DLTO_SUPPORT -DTRIE_SUPPORT -g -Wall -Wno-format-nonliteral -I. -I./../include -I.  -arch x86_64 -I/opt/local/libexec/llvm-3.0/include  -DNDEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -O3  -g -fno-common -c -o ./strip.o strip.c

Ah right, there was some other place that was tripping on that...

Well it builds fine for me on Lion with XCode 4.3.2

I looked at the preprocessed source, and it's picking up /opt/local/include/mach-o/prune_trie.h because $CPATH should be set right by base as of r54368 ... which is quite old...

So, are you overriding $CPATH?

comment:16 Changed 13 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Resolution: fixed
Status: reopenedclosed

Yeah, I can reproduce this by setting CPATH to something nonsensical...

r92118

comment:17 Changed 13 years ago by jmroot (Joshua Root)

Older versions of clang don't support CPATH, unfortunately. I think even the Xcode 4.3.2 version doesn't support LIBRARY_PATH either.

comment:18 in reply to:  16 Changed 13 years ago by michelle.lynn.gill@…

Replying to jeremyhu@…:

Yeah, I can reproduce this by setting CPATH to something nonsensical...

r92118

I was able to successfully install cctools with r92118. Thanks!

comment:19 Changed 13 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Yeah, it looks like CPATH support was added in the llvm-3.0 cycle, and LIBRARY_PATH was added in the llvm-3.1 cycle.

I was building fine with XCode 4.3.2, but jowens claimed it failed with 4.3.2 ... but maybe John wasn't actually using 4.3.2. /shrug

comment:20 Changed 13 years ago by jowens@…

I can also successfully compile with r92118. I really am running 4.3.2 and have no special CPATH! Anyway, problem solved.

comment:21 Changed 13 years ago by jeremyhu (Jeremy Huddleston Sequoia)

John, your Xcode.app may very well be 4.3.2, but that doesn't mean that your CLTools are 4.3.2. You may need to update them from within XCode.app.

Check the following:

/usr/bin/clang --version
xcrun clang --version
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang --version

You should see version 318.0.58 for all of them, and you should be able to see:

$ strings /path/to/each/clang | grep CPATH
CPATH

comment:22 Changed 13 years ago by ryandesign (Ryan Carsten Schmidt)

Summary: cctools compilation error: macho-/prune_trie.h not foundcctools compilation error: mach-o/prune_trie.h not found

Has duplicate (or recurrence?) #34257.

Note: See TracTickets for help on using tickets.