tech-pkg archive

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

libtool, -fstack-protector, -nostdlib, and while we're at it -Bdirect on SunOS

In order to get over suppression of -fstack-protector namely in SunOS builds for perl and cups, I've been testing for a real long time now
a patch found on libtool-patches@ in the following thread:
Re: Bug: linking shared libraries on Cygwin results in undefined references to 
__stack_chck_guard for code compiled with -fstack-protector

This patch prevents libtools link phase from suppressing '-fstack-protector*' switches such that gcc can issue the proper link statement.

Well, that was fine for gcc, but when building with g++ libtool adds for some reason '-nostdlib' which foils the above patch, so that needed attending to. It is useful to know that this patch fixes similar problems with, for example, '-pthread' and others!

Then, Mr Orth found a problem on SunOS x86_64 with -Bdirect as mentioned here: and

So I have some patches found here: that I've been using without issue on both i386 and x86_64.


  permits libtool to generate -fstack-protector* on all platforms.

  affects only SunOS x86_64 libtool, gcc47 & gcc48

  suppresses -nostdlib with g++ on SunOS only  (see note # below)

  re-enable in perl

  re-enable in perl

Note # other platforms that wish to test suppression of '-nostdlib' will need to apply a similar patch for their target. Apparently
the darwin platform may have (or have had) issues...

I encourage direct participation in the libtool@ discussion
'g++ and -nostdlib'

NB libtool-base is *not* revbump'd in the any of the above patches, although gcc*, cups, and perl are.

Home | Main Index | Thread Index | Old Index