bugGNU Octave - Bugs: bug #56505, setting CXX should affect...

 
 

bug #56505: setting CXX should affect mkoctfile link stage as well

Submitted by:  Mike Miller <mtmiller>
Submitted on:  Sun 16 Jun 2019 06:07:39 PM UTC  
 
Category:  Configuration and Build System Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Feature Request
Status:  None Assigned to:  None
Originator Name:  Open/Closed:  Open
Release:  dev Operating System:  GNU/Linux

Add a New Comment (Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Mon 17 Jun 2019 08:29:30 PM UTC, comment #2: 

That seems reasonable to me.  I don't remember now why we have these separate variables.  I also agree that if CXXLD is not explicitly set, then it should use the value of CXX.

John W. Eaton <jwe>
Project Administrator
Mon 17 Jun 2019 06:42:25 PM UTC, comment #1: 

I'm leaning towards combining the three linker variables 'DL_LD', 'LD_CXX', and 'SH_LD'. They all seem to be some definition of a linker, and in the typical use case they should all be set to the same thing as 'CXX'. I think the new combined variable should be called 'CXXLD' for consistency with GNU Automake.

Then part 2 would be to add logic to mkoctfile, such that if the user environment sets 'CXX' but not 'CXXLD', the value of 'CXX' should be used for both the 'CXX' and 'CXXLD' internal variables.

Any objections to any of that in theory?

Mike Miller <mtmiller>
Project Administrator
Sun 16 Jun 2019 06:07:39 PM UTC, original submission:  

The mkoctfile program uses a separate non-standard internal variable for the name of the  linker program to call when building oct files, and a separate one for the name of the linker to use when building standalone programs.

I think that setting the CXX variable should also override the name of the linker. If we still want the user to be able to set both the compiler and linker independently, we should use a more standard variable name, either something like LD or CXXLD.

Example of current behavior

>> mkoctfile -v dummy.cc
g++ -c -fPIC -I… -pthread -fopenmp -g -O2 dummy.cc -o /tmp/oct-Cwseid.o
g++ -I… -pthread -fopenmp -g -O2 -shared -Wl,-Bsymbolic -o dummy.oct  /tmp/oct-Cwseid.o
>>
>> setenv CXX clang
>> mkoctfile -v dummy.cc
clang -c -fPIC -I… -pthread -fopenmp -g -O2 dummy.cc -o /tmp/oct-MCpC7P.o
g++ -I… -pthread -fopenmp -g -O2 -shared -Wl,-Bsymbolic -o dummy.oct  /tmp/oct-MCpC7P.o

It would be more user friendly if the second command shown, the link stage, also used clang by virtue of the user setting CXX. Currently the user has to know about the special Octave environment variable 'DL_LD'.

As far as I can tell, 'DL_LD' is always set to the same thing as 'CXX' when Octave is built. So is the 'LD_CXX' variable. These two linker variables look redundant to me and I think we could combine them into one.

Mike Miller <mtmiller>
Project Administrator

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by jwe (Posted a comment)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

     

     

    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-06-16 mtmiller Carbon-CopyRemoved 80942 => -

    Back to the top


    Powered by Savane 3.5