[LLVMbugs] [Bug 4514] New: clang cant compile gettext

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Tue Jul 7 14:10:05 PDT 2009


http://llvm.org/bugs/show_bug.cgi?id=4514

           Summary: clang cant compile gettext
           Product: clang
           Version: unspecified
          Platform: PC
        OS/Version: FreeBSD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: preprocessor
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: rdivacky at freebsd.org
                CC: llvmbugs at cs.uiuc.edu


this works:

witten src# gcc -E -DLOCALEDIR=\"/usr/local/share/locale\" -DHAVE_CONFIG_H -I.
-I.. -I. -I. -I.. -I../intl -I./../intl -I../gnulib-lib -I./../gnulib-lib
-I/usr/local/include -DINSTALLDIR=\"/usr/local/bin\" -O2 -pipe
-DMALLOC_PRODUCTION -march=native -fno-strict-aliasing -c gettext.c >
/tmp/gettext.c

witten src# cp /tmp/gettext.c .

witten src# clang -c gettext.c -o gettext-gettext.o                             

witten src# /bin/sh /usr/local/bin/libtool --tag=CC --mode=link clang
-DINSTALLDIR=\"/usr/local/bin\" -O2 -pipe -DMALLOC_PRODUCTION -march=native
-fno-strict-aliasing -L/usr/local/lib -o gettext gettext-gettext.o
../gnulib-lib/libgrt.a ../intl/libintl.la -L/usr/local/lib -liconv
-R/usr/local/lib -L/usr/local/lib -liconv -R/usr/local/lib                     
                                                                               
                clang -DINSTALLDIR=\"/usr/local/bin\" -O2 -pipe
-DMALLOC_PRODUCTION -march=native -fno-strict-aliasing -o .libs/gettext
gettext-gettext.o  -L/usr/local/lib ../gnulib-lib/libgrt.a
../intl/.libs/libintl.so /usr/local/lib/libiconv.so  -Wl,--rpath
-Wl,/usr/local/lib
clang: warning: argument unused during compilation:
'-DINSTALLDIR="/usr/local/bin"'
clang: warning: argument unused during compilation: '-O2'
clang: warning: argument unused during compilation: '-DMALLOC_PRODUCTION'
clang: warning: argument unused during compilation: '-march=native'
clang: warning: argument unused during compilation: '-fno-strict-aliasing'
creating gettext

witten src# 

ie. use CPP from gcc and then compile the resulting C code with clang and call
libtool (which uses clang for linking) to link it all

this does NOT work:

witten src# clang -E -DLOCALEDIR=\"/usr/local/share/locale\" -DHAVE_CONFIG_H
-I. -I.. -I. -I. -I.. -I../intl -I./../intl -I../gnulib-lib -I./../gnulib-lib
-I/usr/local/include -DINSTALLDIR=\"/usr/local/bin\" -O2 -pipe
-DMALLOC_PRODUCTION -march=native -fno-strict-aliasing -c gettext.c >
/tmp/gettext.c  clang: warning: argument unused during compilation: '-c'

witten src# cp /tmp/gettext.c .

witten src# clang -c gettext.c -o gettext-gettext.o
                                                                               
witten src# /bin/sh /usr/local/bin/libtool --tag=CC --mode=link clang
-DINSTALLDIR=\"/usr/local/bin\" -O2 -pipe -DMALLOC_PRODUCTION -march=native
-fno-strict-aliasing -L/usr/local/lib -o gettext gettext-gettext.o
../gnulib-lib/libgrt.a ../intl/libintl.la -L/usr/local/lib -liconv
-R/usr/local/lib -L/usr/local/lib -liconv -R/usr/local/lib
clang -DINSTALLDIR=\"/usr/local/bin\" -O2 -pipe -DMALLOC_PRODUCTION
-march=native -fno-strict-aliasing -o .libs/gettext gettext-gettext.o 
-L/usr/local/lib ../gnulib-lib/libgrt.a ../intl/.libs/libintl.so
/usr/local/lib/libiconv.so  -Wl,--rpath -Wl,/usr/local/lib
clang: warning: argument unused during compilation:
'-DINSTALLDIR="/usr/local/bin"'
clang: warning: argument unused during compilation: '-O2'
clang: warning: argument unused during compilation: '-DMALLOC_PRODUCTION'
clang: warning: argument unused during compilation: '-march=native'
clang: warning: argument unused during compilation: '-fno-strict-aliasing'
gettext-gettext.o(.text+0x81): In function `main':
: undefined reference to `_libintl_bindtextdomain'
gettext-gettext.o(.text+0x8e): In function `main':
: undefined reference to `_libintl_textdomain'
gettext-gettext.o(.text+0x1e3): In function `main':
: undefined reference to `_libintl_gettext'
gettext-gettext.o(.text+0x201): In function `main':
: undefined reference to `_libintl_gettext'
gettext-gettext.o(.text+0x27d): In function `main':
: undefined reference to `_libintl_gettext'
gettext-gettext.o(.text+0x2bd): In function `main':
: undefined reference to `_libintl_gettext'
gettext-gettext.o(.text+0x359): In function `main':
: undefined reference to `_libintl_bindtextdomain'
gettext-gettext.o(.text+0x36b): In function `main':
: undefined reference to `_libintl_dgettext'
gettext-gettext.o(.text+0x3d7): In function `main':
: undefined reference to `_libintl_bindtextdomain'
gettext-gettext.o(.text+0x42b): In function `main':
: undefined reference to `_libintl_dgettext'
gettext-gettext.o(.text+0x4d7): In function `usage':
: undefined reference to `_libintl_gettext'
gettext-gettext.o(.text+0x502): In function `usage':
: undefined reference to `_libintl_gettext'
gettext-gettext.o(.text+0x538): In function `usage':
: undefined reference to `_libintl_gettext'
gettext-gettext.o(.text+0x55c): In function `usage':
: undefined reference to `_libintl_gettext'
gettext-gettext.o(.text+0x580): In function `usage':
: undefined reference to `_libintl_gettext'
gettext-gettext.o(.text+0x5d9): more undefined references to `_libintl_gettext'
follow
clang: error: linker command failed with exit code 1 (use -v to see invocation)

witten src# 

ie. exactly the same steps as before except that I used clang's cpp. when I try
to use gcc to compile the clang's CPP produced C code it emits:

witten src# gcc -c gettext.c -o gettext-gettext.o      
line-map.c: file "gettext.c" left but not entered

I dont know what I should provide for you to fix this but feel free to ask I
can provide whatever you want


-- 
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