[LLVMbugs] [Bug 4140] New: clang -print-file-name not consistent with gcc
bugzilla-daemon at cs.uiuc.edu
bugzilla-daemon at cs.uiuc.edu
Sun May 3 11:32:48 PDT 2009
http://llvm.org/bugs/show_bug.cgi?id=4140
Summary: clang -print-file-name not consistent with gcc
Product: new-bugs
Version: unspecified
Platform: PC
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P2
Component: new bugs
AssignedTo: unassignedbugs at nondot.org
ReportedBy: edwintorok at gmail.com
CC: llvmbugs at cs.uiuc.edu
Blocks: 4068
$ gcc -print-file-name=libncursesw.so
/usr/lib/gcc/x86_64-linux-gnu/4.3.3/../../../../lib/libncursesw.so
$ clang
libncursesw.so
This is causing silent failures during evaluating of certain variables in
Makefile, which in turn leads to link failures because a required -l line is
missing.
$ make HOSTCC=clang CC=clang menuconfig
fails with lots of undefined references to symbols in ncurses
The link line is:
clang -o scripts/kconfig/mconf scripts/kconfig/mconf.o
scripts/kconfig/zconf.tab.o scripts/kconfig/lxdialog/checklist.o
scripts/kconfig/lxdialog/util.o scripts/kconfig/lxdialog/inputbox.o
scripts/kconfig/lxdialog/textbox.o scripts/kconfig/lxdialog/yesno.o
scripts/kconfig/lxdialog/menubox.o
vs. the link line with gcc:
gcc -o scripts/kconfig/mconf scripts/kconfig/mconf.o
scripts/kconfig/zconf.tab.o scripts/kconfig/lxdialog/checklist.o
scripts/kconfig/lxdialog/util.o scripts/kconfig/lxdialog/inputbox.o
scripts/kconfig/lxdialog/textbox.o scripts/kconfig/lxdialog/yesno.o
scripts/kconfig/lxdialog/menubox.o -lncursesw
This is because check-lxdialog.sh -ldflags clang outputs nothing:
/bin/sh -x
/home/edwin/builds/linux-2.6/scripts/kconfig/lxdialog/check-lxdialog.sh
-ldflags clang
+ tmp=.lxdialog.tmp
+ trap 'rm -f .lxdialog.tmp' 0 1 2 3 15
+ '[' 2 -eq 0 ']'
+ cc=
+ case "$1" in
+ shift
+ cc=clang
+ ldflags
+ for ext in so a dylib
+ for lib in ncursesw ncurses curses
+ clang -print-file-name=libncursesw.so
+ grep -q /
+ '[' 1 -eq 0 ']'
+ for lib in ncursesw ncurses curses
+ clang -print-file-name=libncurses.so
+ grep -q /
+ '[' 1 -eq 0 ']'
+ for lib in ncursesw ncurses curses
+ clang -print-file-name=libcurses.so
+ grep -q /
+ '[' 1 -eq 0 ']'
+ for ext in so a dylib
+ for lib in ncursesw ncurses curses
+ clang -print-file-name=libncursesw.a
+ grep -q /
+ '[' 1 -eq 0 ']'
+ for lib in ncursesw ncurses curses
+ clang -print-file-name=libncurses.a
+ grep -q /
+ '[' 1 -eq 0 ']'
+ for lib in ncursesw ncurses curses
+ clang -print-file-name=libcurses.a
+ grep -q /
+ '[' 1 -eq 0 ']'
+ for ext in so a dylib
+ for lib in ncursesw ncurses curses
+ clang -print-file-name=libncursesw.dylib
+ grep -q /
+ '[' 1 -eq 0 ']'
+ for lib in ncursesw ncurses curses
+ clang -print-file-name=libncurses.dylib
+ grep -q /
+ '[' 1 -eq 0 ']'
+ for lib in ncursesw ncurses curses
+ clang -print-file-name=libcurses.dylib
+ grep -q /
+ '[' 1 -eq 0 ']'
+ exit 1
+ rm -f .lxdialog.tmp
This is how gcc behaves:
+ tmp=.lxdialog.tmp
+ trap 'rm -f .lxdialog.tmp' 0 1 2 3 15
+ '[' 2 -eq 0 ']'
+ cc=
+ case "$1" in
+ shift
+ cc=gcc
+ ldflags
+ for ext in so a dylib
+ for lib in ncursesw ncurses curses
+ gcc -print-file-name=libncursesw.so
+ grep -q /
+ '[' 0 -eq 0 ']'
+ echo -lncursesw
-lncursesw
+ exit
+ rm -f .lxdialog.tmp
--
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
More information about the llvm-bugs
mailing list