mainGNU Libtool - Support: sr #110542, Patch to libtool for solaris 11.4...

 
 

sr #110542: Patch to libtool for solaris 11.4 link-editor which rejects -pthread option

Submitter:  Stacey Marshall <staceym>
Submitted:  Mon 20 Sep 2021 10:24:04 AM UTC
   
 
Category:  None Priority:  5 - Normal
Severity:  3 - Normal Status:  Done
Privacy:  Public Assigned to:  growpotkin
Open/Closed:  Closed Operating System:  Solaris
* Mandatory Fields

Add a New Comment Rich Markup
   

Mon 20 Sep 2021 10:24:04 AM UTC, original submission:  

Solaris 11.4 link-editor, ld(1), has been updated to reject options '-thread' and '-pthread'.

Details from Oracle Bug 22985199 ld(1) should weed out invalid options -thread and -pthread

> 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
>     [0]  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
>      [0]  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

Stacey Marshall <staceym>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #51948:  libtool-Solaris-ld.patch added by staceym (902B - application/octet-stream - Patch file)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by growpotkin (Updated the item)
  • -email is unavailable- added by staceym (Submitted the item)
  • -email is unavailable- added by staceym
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2022-05-08 growpotkin StatusNone Done
        Assigned toNone growpotkin
        Open/ClosedOpen Closed
    2021-09-20 staceym Attached File- Added libtool-Solaris-ld.patch, #51948
        Carbon-Copy- Added staceym

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code