[Expat-bugs] [ expat-Bugs-780087 ] bad gcc flag when linking
library in Soalris 2.8
SourceForge.net
noreply at sourceforge.net
Wed Jul 30 02:44:54 EDT 2003
Bugs item #780087, was opened at 2003-07-30 01:44
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=110127&aid=780087&group_id=10127
Category: Build control
Group: Platform Specific
Status: Open
Resolution: None
Priority: 5
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Greg Stein (gstein)
Summary: bad gcc flag when linking library in Soalris 2.8
Initial Comment:
expat 1.95.5, 1.95.6
When libtool links the lib/xmlparse.lo lib/xmltok.lo
lib/xmlrole.lo into libexpat.la on Solaris 2.8 when using
gcc(3.3 or 3.1), libgcc(3.1 or 3.3) and binutils
(2.11.2) ,from SunFreeware.com, it includes the '-no-
undefined' flag which causes the make to always fail
with a "main not found in crt1.o" error.
This of course is silly 'coz a library has no 'main', see gcc
discusion http://www.geocrawler.com/mail/msg.php3?
msg_id=2903632&list=28.
Looking at libtools "link" case statement I see it
sets "allow_undefined=yes" but this does not translate
to the make line. Could this be a problem?
When I manually edited the "make" line, removing the
flag '-no-undefined' the library was built without error.
As this stops expat building from source on the above
platform can I sugest that this is considered an urgent
bug to be fixed?
Of course I could be wrong :-) Here's an example (I've
used 1.95.5 to avoid all those regparm warning
messages you get in 1.95.6 on Solaris with gcc 3.1/3.3)
snip---
Script started on Wed Jul 30 09:41:53 2003
sh-2.03$ cd expat-1.95.5
sh-2.03$ make distclean ; ./configure ; make
cd lib && rm -f libexpat.la *.o *.lo && rm -rf .libs _libs
cd xmlwf && rm -f xmlwf *.o *.lo && rm -rf .libs _libs
cd examples && rm -f elements outline *.o *.lo && rm -
rf .libs _libs
cd tests && rm -rf .libs runtests runtests.o chardata.o
rm -rf .libs libexpat.la
find . -name core | xargs rm -f
rm -f expat_config.h config.status config.log
config.cache libtool
rm -f Makefile
checking build system type... sparc-sun-solaris2.8
checking host system type... sparc-sun-solaris2.8
checking for gcc... /usr/local/bin/gcc
checking for C compiler default output... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether /usr/local/bin/gcc accepts -g... yes
checking for ld used by GCC... /usr/local/bin/gcc
checking if the linker (/usr/local/bin/gcc) is GNU ld... no
checking for /usr/local/bin/gcc option to reload object
files... -r
checking for BSD-compatible nm... /usr/local/bin/nm -B
checking whether ln -s works... yes
checking how to recognise dependant libraries... pass_all
checking command to parse /usr/local/bin/nm -B
output... ok
checking how to run the C
preprocessor... /usr/local/bin/gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... no
checking for unistd.h... yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking for ranlib... ranlib
checking for strip... strip
checking for objdir... .libs
checking for /usr/local/bin/gcc option to produce PIC... -
fPIC
checking if /usr/local/bin/gcc PIC flag -fPIC works... yes
checking if /usr/local/bin/gcc static flag -static works...
yes
checking if /usr/local/bin/gcc supports -c -o file.o... yes
checking if /usr/local/bin/gcc supports -c -o file.lo... yes
checking if /usr/local/bin/gcc supports -fno-rtti -fno-
exceptions... yes
checking whether the linker (/usr/local/bin/gcc) supports
shared libraries... ye
s
checking how to hardcode library paths into programs...
immediate
checking whether stripping libraries is possible... yes
checking dynamic linker characteristics... solaris2.8 ld.so
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
creating libtool
checking for gcc... (cached) /usr/local/bin/gcc
checking whether we are using the GNU C compiler...
(cached) yes
checking whether /usr/local/bin/gcc accepts -g...
(cached) yes
checking for a BSD-compatible install... conftools/install-
sh -c
checking whether gcc accepts -fexceptions... yes
checking for ANSI C header files... (cached) yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking for unistd.h... (cached) yes
checking whether byte ordering is bigendian... yes
checking for /usr/local/bin/gcc option to accept ANSI
C... none needed
checking for an ANSI C-conforming const... yes
checking for off_t... yes
checking for size_t... yes
checking for working memcmp... yes
checking for stdlib.h... (cached) yes
checking for unistd.h... (cached) yes
checking for getpagesize... yes
checking for working mmap... yes
checking for memmove... yes
checking for bcopy... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating expat_config.h
/bin/bash ./libtool --silent --
mode=compile /usr/local/bin/gcc -g -O2 -Wall -Wmi
ssing-prototypes -Wstrict-prototypes -fexceptions -
I./lib -I. -o lib/xmlparse.
lo -c lib/xmlparse.c
/bin/bash ./libtool --silent --
mode=compile /usr/local/bin/gcc -g -O2 -Wall -Wmi
ssing-prototypes -Wstrict-prototypes -fexceptions -
I./lib -I. -o lib/xmltok.lo
-c lib/xmltok.c
/bin/bash ./libtool --silent --
mode=compile /usr/local/bin/gcc -g -O2 -Wall -Wmi
ssing-prototypes -Wstrict-prototypes -fexceptions -
I./lib -I. -o lib/xmlrole.l
o -c lib/xmlrole.c
/bin/bash ./libtool --silent --
mode=link /usr/local/bin/gcc -g -O2 -Wall -Wmissi
ng-prototypes -Wstrict-prototypes -fexceptions -
I./lib -I. -no-undefined -vers
ion-info 4:0:4 -rpath /usr/local/lib -o libexpat.la
lib/xmlparse.lo lib/xmltok.lo lib/xmlrole.lo
Undefined first referenced
symbol in file
main /usr/local/lib/gcc-lib/sparc-
sun-solaris2.8/
3.3/crt1.o
ld: fatal: Symbol referencing errors. No output written
to .libs/libexpat.so.0.4
.0
collect2: ld returned 1 exit status
*** Error code 1
make: Fatal error: Command failed for target `libexpat.la'
sh-2.03$ exit
script done on Wed Jul 30 09:43:53 2003
snip---
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=110127&aid=780087&group_id=10127
More information about the Expat-bugs
mailing list