Re: 64-bit library on Solaris SPARC

2006-05-11 Thread Marcel Martin
Am Donnerstag, 11. Mai 2006 13:08 schrieb Ralf Wildenhues:
> Workaround: create a libtool script designed for 64bit linking only, and
> adjust the variables
>   compiler_lib_search_path
> and maybe also
>   sys_lib_search_path_spec
>   sys_lib_dlsearch_path_spec
>
> to point to the right directories.

Thanks (also for the promptness of your reply), that works quite well. Just 
for the record: I also had to change predep_objects and postdep_objects.

Bye,
Marcel


___
Bug-libtool mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-libtool


Re: 64-bit library on Solaris SPARC

2006-05-11 Thread Ralf Wildenhues
Hi Marcel,

* Marcel Martin wrote on Thu, May 11, 2006 at 01:01:36PM CEST:
> 
> I'm trying to build a 64-bit library on Solaris 9 SPARC. I'm actually using 
> autotools with a larger project, but I could reduce the problem to this small 
> test case which uses only libtool:

> $ libtool --mode=link g++ -rpath /usr/local/lib -m64 -o libmini.la \ 
> -no-undefined -version-info 0:0:0 mini.lo
> g++ -shared -nostdlib  
> /vol/gcc-3.4.3/lib/gcc/sparc-sun-solaris2.9/3.4.3/crti.o 
> /usr/ccs/lib/values-Xa.o 
> /vol/gcc-3.4.3/lib/gcc/sparc-sun-solaris2.9/3.4.3/crtbegin.o  .libs/mini.o  
> -Wl,-R -Wl,/vol/gcc-3.4.3/lib/gcc/sparc-sun-solaris2.9/3.4.3 -Wl,-R 
*snip*

> ld: fatal: file .libs/mini.o: wrong ELF class: ELFCLASS64
> ld: fatal: File processing errors. No output written to .libs/libmini.so.0.0.0
> collect2: ld returned 1 exit status
> 
> The problem is that incorrect paths are used: For example, instead of
> /vol/gcc-3.4.3/lib/gcc/sparc-sun-solaris2.9/3.4.3/crti.o it should be
> /vol/gcc-3.4.3/lib/gcc/sparc-sun-solaris2.9/3.4.3/sparcv9/crti.o
> If I change the paths and do the g++ call manually, it works.
> 
> I guess this is or has to do with the multilib problem which has come up on 
> the list before, but I'm still at a loss at what to do now. Is there a 
> solution or a workaround for this problem?

Workaround: create a libtool script designed for 64bit linking only, and
adjust the variables
  compiler_lib_search_path
and maybe also
  sys_lib_search_path_spec
  sys_lib_dlsearch_path_spec

to point to the right directories.  These variables are set for the C
compiler at the beginning of the script, and for the C++ and other
compilers at the very end.

A fix is still to be done.

Cheers,
Ralf


___
Bug-libtool mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-libtool


64-bit library on Solaris SPARC

2006-05-11 Thread Marcel Martin
Hello,

I'm trying to build a 64-bit library on Solaris 9 SPARC. I'm actually using 
autotools with a larger project, but I could reduce the problem to this small 
test case which uses only libtool:

$ echo "int f(int a, int b) { return a+b; }" > mini.cpp

$ libtool --mode=compile g++ -m64 -c -o mini.lo mini.cpp
 g++ -m64 -c mini.cpp  -fPIC -DPIC -o .libs/mini.o
 g++ -m64 -c mini.cpp -o mini.o >/dev/null 2>&1

$ libtool --mode=link g++ -rpath /usr/local/lib -m64 -o libmini.la \ 
-no-undefined -version-info 0:0:0 mini.lo
g++ -shared 
-nostdlib  /vol/gcc-3.4.3/lib/gcc/sparc-sun-solaris2.9/3.4.3/crti.o 
/usr/ccs/lib/values-Xa.o 
/vol/gcc-3.4.3/lib/gcc/sparc-sun-solaris2.9/3.4.3/crtbegin.o  .libs/mini.o  
-Wl,-R -Wl,/vol/gcc-3.4.3/lib/gcc/sparc-sun-solaris2.9/3.4.3 -Wl,-R 
-Wl,/vol/gcc-3.4.3/lib/gcc/sparc-sun-solaris2.9/3.4.3 
-L/vol/gcc-3.4.3/lib/gcc/sparc-sun-solaris2.9/3.4.3 -L/usr/ccs/bin 
-L/usr/ccs/lib 
-L/vol/gcc-3.4.3/lib/gcc/sparc-sun-solaris2.9/3.4.3/../../.. 
/vol/gcc-3.4.3/lib/gcc/sparc-sun-solaris2.9/3.4.3/libstdc++.so 
-L/vol/src/gnu/gcc/gcc-3.4.3/sparc-sun-solaris2.9/libstdc++-v3/src 
-L/vol/src/gnu/gcc/gcc-3.4.3/sparc-sun-solaris2.9/libstdc++-v3/src/.libs 
-L/vol/src/gnu/gcc/gcc-3.4.3/gcc -L/vol/gcc-3.4.3/lib -lm 
-lgcc /vol/gcc-3.4.3/lib/gcc/sparc-sun-solaris2.9/3.4.3/crtend.o 
/vol/gcc-3.4.3/lib/gcc/sparc-sun-solaris2.9/3.4.3/crtn.o  
-m64 -Wl,-h -Wl,libmini.so.0 -o .libs/libmini.so.0.0.0
ld: fatal: file .libs/mini.o: wrong ELF class: ELFCLASS64
ld: fatal: File processing errors. No output written to .libs/libmini.so.0.0.0
collect2: ld returned 1 exit status

The problem is that incorrect paths are used: For example, instead of
/vol/gcc-3.4.3/lib/gcc/sparc-sun-solaris2.9/3.4.3/crti.o it should be
/vol/gcc-3.4.3/lib/gcc/sparc-sun-solaris2.9/3.4.3/sparcv9/crti.o
If I change the paths and do the g++ call manually, it works.

I guess this is or has to do with the multilib problem which has come up on 
the list before, but I'm still at a loss at what to do now. Is there a 
solution or a workaround for this problem?

I'm using libtool version 1.5.22, the problem also occurs with the CVS 
snapshot ("version 2.1a") from today.

Thanks,
Marcel


___
Bug-libtool mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-libtool