Re: [xml] Build failure on Sparc solaris using gcc and binutils



I looked a bit deeper into details and ask myself whether the check for Solaris and static usage of -M option is a good idea at all.

If a linker supports option --version-script it should be used no matter which operating system is in use.

First of all I suggest to change the line:
$(/usr/bin/ld --help 2>&1 | grep -- --version-script >/dev/null) && \
to:
$($LD --help 2>&1 | grep -- --version-script >/dev/null) && \
$LD is obtained correctly from configure script.

Second I'd see one possible solution in simply removing the two lines for the Solaris setting ;-)
test "`uname`" == "SunOS" && \
VERSION_SCRIPT_FLAGS="-Wl,-M -Wl,"

This has the following reasons:
1. It makes no assumption about the linker in use. As reported for gnu ld -M is the wrong option.
2. On another machine with Intel Solaris Sun ld (/usr/ccs/bin/ld) is used. This knows -M option but expects a mapping file as argument, which seems to be something different than the symbol file. The result is: libxml build fails on this platform with error "... (symbol has no version assigned)"

So my question is: for which linker -M option is intended? With knowing this, there might be a linker specific check instead of a platform specific one.

Last: It looks like the variable VERSION_SCRIPT_FLAGS is responsible for activating/deactivating usage of version script. Wouldn't it be nice to
control version script usage with a parameter passed to configure? For example --with-version-script. What do you think?


My suggestion as long -M ld option is not clear ;-)

VERSION_SCRIPT_FLAGS=
$($LD --help 2>&1 | grep -- --version-script >/dev/null) && \
    VERSION_SCRIPT_FLAGS=-Wl,--version-script=

if test -n "$VERSION_SCRIPT_FLAGS"; then
  USE_VERSION_SCRIPT_TRUE=
  USE_VERSION_SCRIPT_FALSE='#'
else
  USE_VERSION_SCRIPT_TRUE='#'
  USE_VERSION_SCRIPT_FALSE=
fi


Best regards,
Matthias


Daniel Veillard wrote:
On Mon, Oct 19, 2009 at 03:19:15PM +0200, Matthias Jung wrote:
  
Hi all,
on sparc solaris ./configure.in sets VERSION_SCRIPT_FLAGS to "-Wl,-M  
-Wl," no matter which compiler/linker is used.
Unfortunately gnu gcc/ld does not like -M option for symbol files, which  
causes a build using gcc to fail. Instead good old "--version-script="  
is expectd here.

Any idea how an additional check for gnu ld to be added to configure.in  
could look like?
Wouldn't it be better to use ld from PATH or any magic variable instead  
of using hard wired /usr/bin/ld?

>From configure.in
    
VERSION_SCRIPT_FLAGS=
$(/usr/bin/ld --help 2>&1 | grep -- --version-script >/dev/null) && \
    VERSION_SCRIPT_FLAGS=-Wl,--version-script=
test "`uname`" == "SunOS" && \
    VERSION_SCRIPT_FLAGS="-Wl,-M -Wl,"

 if test -n "$VERSION_SCRIPT_FLAGS"; then
...
      
Maybe this is a no-brainer, but I have absoluteley no knowledge about  
configure scripts except of using them ;-)
    

  I hope someone with a Sun setup can look and propose a configure fix.
I'm sure it's doable, but I don't have this platform around.

Daniel

  

-- 
Matthias Jung
Email: matthias jung prismtech com
Phone: +49-30-440306-38
http://www.xtradyne.com | http://www.prismtech.com

* XTRADYNE Security Infrastructure - a PRISMTECH Product Line *

PrismTech GmbH
Schoenhauser Allee 6-7, D-10119 Berlin, Germany
Ust.-Id.-Nr.: DE814235971
Handelsregister: Amtsgericht Charlottenburg B HRB 96377 B
Geschäftsführer: Keith Raymond Steele

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature



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