libtool
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

porting libtool for PCC compiler


From: Jeremy C. Reed
Subject: porting libtool for PCC compiler
Date: Tue, 19 Feb 2008 11:24:18 -0600 (CST)

I'd like to port libtool for the pcc compiler. I use it on DragonFly, 
NetBSD and sometimes on Linux operating systems.

The "Porting libtool to new systems" documentation suggests I contact your 
list:

- anyone else working on this? (so we don't duplicate effort)

- and any advice on the most effective way of accomplishing adding pcc 
support?

The documentation I read is mostly for adding a new operating system 
platform and not for different compiler.

Note at this time I will be using the same linker. I am only using a 
different compiler. Also pcc is not a C++ compiler.


Here is an example of errors I receive using pcc instead of gcc with 
libtool:

libtool  pcc -o db_archive -Wl,-R/home/reed/pkg/lib db_archive.o err.o 
getlong.o libdb2.la 
*** Warning: inferring the mode of operation is deprecated.
*** Future versions of Libtool will require --mode=MODE be specified.
pcc -o .libs/db_archive -Wl,-R/home/reed/pkg/lib db_archive.o err.o 
getlong.o  ./.libs/libdb2.so 
-L/build/reed/tmp/pkgsrc/databases/db/work.reed/.buildlink/lib  
-Wl,--rpath -Wl,/home/reed/pkg/lib
/usr/libexec/binutils217/elf/ld: warning: type and size of dynamic symbol 
`log_archive' are not defined
/usr/libexec/binutils217/elf/ld: dynamic variable `log_archive' is zero 
size
/usr/libexec/binutils217/elf/ld: warning: type and size of dynamic symbol 
`db_appinit' are not defined
/usr/libexec/binutils217/elf/ld: dynamic variable `db_appinit' is zero 
size
/usr/libexec/binutils217/elf/ld: warning: type and size of dynamic symbol 
`db_appexit' are not defined
/usr/libexec/binutils217/elf/ld: dynamic variable `db_appexit' is zero 
size
/usr/libexec/binutils217/elf/ld: db_archive.o(.text+0x33d): unresolvable 
R_386_PC32 relocation against symbol `log_archive'
/usr/libexec/binutils217/elf/ld: final link failed: Nonrepresentable 
section on output
*** Error code 


And here is an example of libtool built with gcc versus pcc:

--- /home/reed/pkg/bin/libtool          -- with gcc
+++ bin/libtool         -- with pcc
@@ -56,7 +56,7 @@
 build_old_libs=yes
 
 # Whether or not to add -lc for building shared libraries.
-build_libtool_need_lc=no
+build_libtool_need_lc=yes
 
 # Whether or not to disallow shared libs when runtime libs are static
 allow_libtool_libs_with_static_runtimes=no
@@ -82,16 +82,16 @@
 AR_FLAGS="cru"
 
 # A C compiler.
-LTCC="gcc"
+LTCC="cc"
 
 # LTCC compiler flags.
 LTCFLAGS="-O2 -I/usr/include"
 
 # A language-specific compiler.
-CC="gcc"
+CC="cc"
 
 # Is the compiler the GNU C compiler?
-with_gcc=yes
+with_gcc=
 
 # An ERE matcher.
 EGREP="/usr/bin/egrep"
@@ -128,7 +128,7 @@
 reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs"
 
 # How to pass a linker flag through the compiler.
-wl="-Wl,"
+wl=""
 
 # Object file suffix (normally "o").
 objext="o"
@@ -143,7 +143,7 @@
 exeext=""
 
 # Additional compiler flags for building library objects.
-pic_flag=" -fPIC -DPIC"
+pic_flag=" -DPIC"
 pic_mode=default
 
 # What is the maximum length of a command?
@@ -168,13 +168,13 @@
 dlopen_self=yes
 
 # Whether dlopen of statically linked programs is supported.
-dlopen_self_static=no
+dlopen_self_static=yes
 
 # Compiler flag to prevent dynamic linking.
-link_static_flag="-static"
+link_static_flag=""
 
 # Compiler flag to turn off builtin functions.
-no_builtin_flag=" -fno-builtin"
+no_builtin_flag=""
 
 # Compiler flag to allow reflexive dlopens.
 export_dynamic_flag_spec="\${wl}--export-dynamic"
@@ -316,13 +316,13 @@
 
 # Variables whose values should be saved in libtool wrapper scripts and
 # restored at relink time.
-variables_saved_for_relink="PATH LD_LIBRARY_PATH LD_RUN_PATH GCC_EXEC_PREFIX 
COMPILER_PATH LIBRARY_PATH"
+variables_saved_for_relink="PATH LD_LIBRARY_PATH LD_RUN_PATH"
 
 # Whether libtool must link a program against all its dependency libraries.
 link_all_deplibs=unknown
 
 # Compile-time system search path for libraries
-sys_lib_search_path_spec="/usr/lib/gcc34"
+sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
 
 # Run-time system search path for libraries
 sys_lib_dlsearch_path_spec="/lib /usr/lib"
@@ -7411,7 +7411,7 @@
 AR_FLAGS="cru"
 
 # A C compiler.
-LTCC="gcc"
+LTCC="cc"
 
 # LTCC compiler flags.
 LTCFLAGS="-O2 -I/usr/include"
@@ -7497,7 +7497,7 @@
 dlopen_self=yes
 
 # Whether dlopen of statically linked programs is supported.
-dlopen_self_static=no
+dlopen_self_static=yes
 
 # Compiler flag to prevent dynamic linking.
 link_static_flag="-static"
@@ -7651,7 +7651,7 @@
 link_all_deplibs=unknown
 
 # Compile-time system search path for libraries
-sys_lib_search_path_spec="/usr/lib/gcc34"
+sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
 
 # Run-time system search path for libraries
 sys_lib_dlsearch_path_spec="/lib /usr/lib"
@@ -7716,7 +7716,7 @@
 AR_FLAGS="cru"
 
 # A C compiler.
-LTCC="gcc"
+LTCC="cc"
 
 # LTCC compiler flags.
 LTCFLAGS="-O2 -I/usr/include"
@@ -7762,7 +7762,7 @@
 reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs"
 
 # How to pass a linker flag through the compiler.
-wl="-Wl,"
+wl=""
 
 # Object file suffix (normally "o").
 objext="o"
@@ -7777,7 +7777,7 @@
 exeext=""
 
 # Additional compiler flags for building library objects.
-pic_flag=" -fPIC"
+pic_flag=""
 pic_mode=default
 
 # What is the maximum length of a command?
@@ -7802,7 +7802,7 @@
 dlopen_self=yes
 
 # Whether dlopen of statically linked programs is supported.
-dlopen_self_static=no
+dlopen_self_static=yes
 
 # Compiler flag to prevent dynamic linking.
 link_static_flag=""
@@ -7950,13 +7950,13 @@
 
 # Variables whose values should be saved in libtool wrapper scripts and
 # restored at relink time.
-variables_saved_for_relink="PATH LD_LIBRARY_PATH LD_RUN_PATH GCC_EXEC_PREFIX 
COMPILER_PATH LIBRARY_PATH"
+variables_saved_for_relink="PATH LD_LIBRARY_PATH LD_RUN_PATH"
 
 # Whether libtool must link a program against all its dependency libraries.
 link_all_deplibs=unknown
 
 # Compile-time system search path for libraries
-sys_lib_search_path_spec="/usr/lib/gcc34"
+sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
 
 # Run-time system search path for libraries
 sys_lib_dlsearch_path_spec="/lib /usr/lib"


The above examples are from pkgsrc's libtool based on libtool 1.5.24.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]