Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#37878 closed defect (fixed)

qt4-mac: The compiler (/usr/bin/llvm-g++-4.2) does not seem to support the LIBRARY_PATH environment variable, which is required to compile qt4-mac

Reported by: ryandesign (Ryan Carsten Schmidt) Owned by: michaelld (Michael Dickens)
Priority: Normal Milestone:
Component: ports Version: 2.1.2
Keywords: Cc:
Port: qt4-mac

Description

qt4-mac fails as follows on Lion with Xcode 4.3.3:

CPATH support detected
LIBRARY_PATH support not detected
error: The compiler (/usr/bin/llvm-g++-4.2) does not seem to support the LIBRARY_PATH environment variable, which is required to compile qt4-mac using MacPorts when compiling on Mac OS X.
$ xcodebuild -version
Xcode 4.3.3
Build version 4E3002
$ llvm-g++-4.2 -version
i686-apple-darwin11-llvm-g++-4.2: no input files
bash-3.2$ llvm-g++-4.2 -v
Using built-in specs.
Target: i686-apple-darwin11
Configured with: /private/var/tmp/llvmgcc42/llvmgcc42-2336.9~22/src/configure --disable-checking --enable-werror --prefix=/Applications/Xcode.app/Contents/Developer/usr/llvm-gcc-4.2 --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-prefix=llvm- --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin11 --enable-llvm=/private/var/tmp/llvmgcc42/llvmgcc42-2336.9~22/dst-llvmCore/Developer/usr/local --program-prefix=i686-apple-darwin11- --host=x86_64-apple-darwin11 --target=i686-apple-darwin11 --with-gxx-include-dir=/usr/include/c++/4.2.1
Thread model: posix
gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.9.00)

Attachments (4)

main.log (61.2 KB) - added by ryandesign (Ryan Carsten Schmidt) 12 years ago.
library_path_test.diff (1.0 KB) - added by michaelld (Michael Dickens) 12 years ago.
main.2.log (8.0 KB) - added by ryandesign (Ryan Carsten Schmidt) 12 years ago.
library_path_test_2.diff (1.5 KB) - added by michaelld (Michael Dickens) 12 years ago.

Download all attachments as: .zip

Change History (12)

Changed 12 years ago by ryandesign (Ryan Carsten Schmidt)

Attachment: main.log added

comment:1 Changed 12 years ago by michaelld (Michael Dickens)

Interesting; not expected. Maybe I messed up that test. I'm attaching a patch that will have this test produce more output. Please do the patch, then re-do the build command for qt4-mac, then post the new log file. Patch is from worksrcpath, "patch -p0".

Last edited 12 years ago by michaelld (Michael Dickens) (previous) (diff)

Changed 12 years ago by michaelld (Michael Dickens)

Attachment: library_path_test.diff added

comment:2 Changed 12 years ago by ryandesign (Ryan Carsten Schmidt)

CPATH support detected
ld: library not found for -lrary_path_lib
collect2: ld returned 1 exit status
Undefined symbols for architecture x86_64:
  "start", referenced from:
     -u command line option
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
LIBRARY_PATH support not detected

Changed 12 years ago by ryandesign (Ryan Carsten Schmidt)

Attachment: main.2.log added

comment:3 Changed 12 years ago by michaelld (Michael Dickens)

Ah; as I suspected. "-nostdlib" changed meaning over the years. Here's a patch, on top of the last one, which should do the trick. This compiler does seem to honor LIBRARY_PATH.

Changed 12 years ago by michaelld (Michael Dickens)

Attachment: library_path_test_2.diff added

comment:4 Changed 12 years ago by ryandesign (Ryan Carsten Schmidt)

That seems to work:

CPATH support detected
ld: library not found for -lrary_path_lib
collect2: ld returned 1 exit status
LIBRARY_PATH support detected

comment:5 Changed 12 years ago by ryandesign (Ryan Carsten Schmidt)

And it still works with those patches on Xcode 4.6's clang on OS X 10.8 too:

CPATH support detected
clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated
clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated
ld: library not found for -lrary_path_lib
clang: error: linker command failed with exit code 1 (use -v to see invocation)
clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated
LIBRARY_PATH support detected

comment:6 Changed 12 years ago by michaelld (Michael Dickens)

OK; thanks. It also works as expected with MacPorts' gcc 4.5 and 4.7, and MacPorts clang 2.9, 3.0, 3.1, and 3.2. So, I think this last change is the way to go. I'll fix it with another ticket's qt4-mac issue later today.

comment:7 Changed 12 years ago by michaelld (Michael Dickens)

Resolution: fixed
Status: newclosed

Fixed in r102396.

comment:8 Changed 12 years ago by michaelld (Michael Dickens)

And r102397 :)

Note: See TracTickets for help on using tickets.