[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[sr #110542] Patch to libtool for solaris 11.4 link-editor which rejects
[sr #110542] Patch to libtool for solaris 11.4 link-editor which rejects -pthread option
Mon, 20 Sep 2021 06:24:06 -0400 (EDT)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:92.0) Gecko/20100101 Firefox/92.0
Summary: Patch to libtool for solaris 11.4 link-editor which
rejects -pthread option
Project: GNU Libtool
Submitted by: staceym
Submitted on: Mon 20 Sep 2021 10:24:04 AM UTC
Priority: 5 - Normal
Severity: 3 - Normal
Assigned to: None
Discussion Lock: Any
Operating System: Solaris
Solaris 11.4 link-editor, ld(1), has been updated to reject options '-thread'
Details from Oracle Bug 22985199 ld(1) should weed out invalid options -thread
> The GNU configuration process has been known to pass the
> options -thread and -pthread to ld(1), or to the compiler
> driver which will try and pass them to ld(1).
> ld(1) uses getopt(3c) processing. The compilers take the
> options they know about and pass the others to ld(1).
> These options, which are specific to gcc, can result in
> silent errors:
> % ld -o null.so -G -thread null.o
> % elfdump -d null.so | fgrep SONAME
>  SONAME 0x5c read
> The -t option is peeled off, being a valid ld(1) option,
> and the rest, '-h read' gets interpreted as an SONAME, which
> is probably not what the user expected. If you tried to
> create an executable, you'd get an error, but it's not
> immediately obvious where the -h came from:
> % ld -o main -thread null.o
> ld: fatal: option '-h read' is incompatible with building \\
> a dynamic executable
> With -pthread we get the same result when building a shared
> object or an executable:
> % ld -o null.so -G -pthread null.o
> % elfdump -d null.so | fgrep AUDIT
>  AUDIT 0x5c thread
> The -p is peeled off, and its optarg used to define an auditor.
> Again, probably not what the user wanted.
> The Studio compilers can behave slightly differently in that
> they can affect the options passed to ld(1): For example
> % cc -o null.so -G -thread null.o
> results in ld(1) seeing distinct options '-t -hread'.
> Given these are "bad" options to ld(1), it would be helpful
> to our Userland developers if ld(1) could recognize them
> rather than falling through to getopt() processing, where the
> options are mis-interpreted and "might" result in an error
> depending on the output file being produced.
The attached patch (libtool-Solaris-ld.patch) prevents '-pthread' from being
passed to ld on solaris2 hosts.
_Originally posted to_ https://debbugs.gnu.org/cgi/bugreport.cgi?bug=34076
Date: Mon 20 Sep 2021 10:24:04 AM UTC Name: libtool-Solaris-ld.patch Size:
902B By: staceym
Reply to this item at:
Message sent via Savannah
- [sr #110542] Patch to libtool for solaris 11.4 link-editor which rejects -pthread option,
Stacey Marshall <=