help with gcc5 install on linux.

Manfred Schwarb manfred99@gmx.ch
Mon Feb 16 23:43:00 GMT 2015


Am 08.02.2015 um 22:08 schrieb Jorge D'Elia:
> Hi again,
>
> 1/2) The following paragraph of my previous message should be:
>
> !    Here, therefore, the ld.gold of my Fedora 14 system
> !    has not plugin support. Then, it was reinstalled using
> !
> !    $ yum reinstall binutils.i686
> !    $ yum reinstall binutils-devel.i686
> !    etc
>
> (I'm sorry ...).
>
> 2/2) BTW, I wonder if the binaries available in
> http://gfortran.com/ could be constructed for use
> the /usr/bin/ld.bfd linker most widely used, and leave
> the /usr/bin/ld.gold one as a second more advanced
> option?
>

I think that is not a choice of the GCC binaries, but of the installed binutils.
At least on my boxes, I get what you describe, without any option
ld.bfd will be used, and with "gfortran -fuse-ld=gold" ld.gold will be used.
Resp. with "gfortran -flto" ld.gold is used.

You can disable the use of linker plugins with "gfortran -fno-use-linker-plugin".
Does compiling with this option work for you?

Cheers,
Manfred


> Greetings.
> Jorge.
>
> ----- Mensaje original -----
>> De: "Jorge D'Elia" <jdelia@intec.unl.edu.ar>
>> Para: "Manfred Schwarb" gmx.ch>
>> CC: mexas@bris.ac.uk, fortran@gcc.gnu.org, "Lisandro Dalcin" <dalcinl@gmail.com>
>> Enviado: Domingo, 8 de Febrero 2015 17:33:15
>> Asunto: Re: help with gcc5 install on linux.
>>
>> Dear Manfred and Anton (cc. Lisandro):
>>
>> Regarding the problems with the use of /usr/bin/ld.gold
>> instead of /usr/bin/ld.bfd in the Gfortran binaries provided
>> in http://gfortran.com/download, I tried some tests:
>>
>> 1/4) Activate ld.gold:
>>
>>     (see http://stackoverflow.com/questions/13321589
>>     /using-gold-in-the-place-of-ld-as-a-system-linker-on-fedora)
>>
>>     Fedora comes out with gold distributed with binutils.
>>     The command is ld.gold. You can select it as the default
>>     linker using alternatives:
>>
>>     [root]# alternatives --config ld
>>     There are 2 programs which provide 'ld'.
>>     Selection    Command
>>     -----------------------------------------------
>>     *+ 1           /usr/bin/ld.bfd
>>        2           /usr/bin/ld.gold
>>     Enter to keep the current selection[+], or type selection number.
>>
>>     Then, verify, e.g.
>>
>>     $ ls -l /usr/bin/ld
>>     $ ld --version
>>
>>     BTW, as we have users that need to use the "ld.bfd" instead,
>>     how to have both linkers for all users?, e.g. perhaps
>>     without the use of "alternatives" and, instead, that each
>>     user defines alias?
>>
>>
>> 2/4) Check Gfortran with a simple test:
>>     $ cat z.f90
>>     program test
>>       implicit none
>>       write(*,*)"hello world! "
>>     end program test
>>
>>     $ gfortran -Wl,-fuse-ld=gold -o z.exe z.f90 2>&1 | tee fuse-ld-gold.log
>>
>>     /usr/bin/ld.gold: -plugin: unknown option
>>     /usr/bin/ld.gold: use the --help option for usage information
>>     collect2: error: ld returned 1 exit status
>>
>>     Here, therefore, the ld.gold of my Fedora 14 system,
>>     reinstalled using
>>
>>     $ yum reinstall binutils.i686
>>     $ yum reinstall binutils-devel.i686
>>
>>     has not plugin support.
>>
>>     For instance, I attach a ld.gold.help file:
>>
>>     $ ld.gold --help &> ld.gold.help
>>
>>
>> 3/4) This lack of plugin support in ld.gold is confirmed from:
>>
>>     http://llvm.org/docs/GoldPlugin.html
>>
>>     where suggest to check:
>>
>>     $ /usr/bin/ld -plugin
>>
>>     which, if it complains "missing argument", then you have plugin
>>     support. If not, such as an "unknown option" error, then you
>>     will either need to build gold or install a version with plugin
>>     support. In our Fedora systems (14, 17 and 19), the output was:
>>
>>     $ /usr/bin/ld -plugin
>>     /usr/bin/ld: -plugin: unknown option
>>     /usr/bin/ld: use the --help option for usage information
>>
>>     again, the same error ouput as before ...
>>
>>
>> 4/4) Following the suggested steps in
>>       http://llvm.org/docs/GoldPlugin.html
>>       I tried to download:
>>
>>     git clone --depth 1 git://sourceware.org/git/binutils-gdb.git binutils2
>>
>>     but it fails with several errors...
>>
>> In conclusion, the question is how to fix the plugin missing support
>> in the "ld.gold" binaries provided by the Fedora distributions (and
>> others?).
>>
>>
>> Regards.
>> Jorge.
>>
>> ----- Mensaje original -----
>>> De: "Manfred Schwarb" gmx.ch>
>>> Para: "Jorge D'Elia" <jdelia@intec.unl.edu.ar>, mexas@bris.ac.uk
>>> CC: fortran@gcc.gnu.org
>>> Enviados: Viernes, 6 de Febrero 2015 13:16:40
>>> Asunto: Re: help with gcc5 install on linux
>>>
>>> Hi,
>>>
>>> I'm still trying to make sense of it.
>>> using google did not help very much, although there was the recommendation
>>> of using -fuse-ld:
>>>
>>> Could you try to
>>>     1) compile your test program with "gfortran -fuse-ld=bfd"
>>>     2) with "gfortran -fuse-ld=gold"
>>>
>>> Does one of them work?
>>>
>>> Does the same issue also appear for gcc? I.e.
>>>     cat > main.c <> int main(void)
>>> {
>>>       return 0;
>>> }
>>> EOF
>>>
>>> ./gcc5/gcc-trunk/bin/gcc -o main main.c
>>>
>>>
>>> One brute force approach would be using strace:
>>>
>>>     strace -f -s 100 ./gcc5/gcc-trunk/bin/gfortran -c z.f90 >z.log 2>&1
>>>
>>> and search inside the logfile z.log for "cannot find" or "ld"
>>> Perhaps we get some clue this way.
>>>
>>>  From tomorrow on, I'm offline for a week, I will try to keep at it.
>>>
>>> Cheers,
>>> Manfred
>>>
>>>
>>>
>>> Am 02.02.2015 um 19:40 schrieb Jorge D'Elia:
>>>> Hi Manfred and Anton,
>>>>
>>>> ----- Mensaje original -----
>>>>> De: "Manfred Schwarb" gmx.ch>
>>>>> Para: mexas@bris.ac.uk, fortran@gcc.gnu.org
>>>>> Enviado: Lunes, 2 de Febrero 2015 12:23:23
>>>>> Asunto: Re: help with gcc5 install on linux
>>>>>
>>>>> Am 02.02.2015 um 15:14 schrieb Anton Shterenlikht:
>>>>>> I usually use gcc installed by others.
>>>>>> I now tried to install gcc5, and get problems.
>>>>>> Please help.
>>>>>>
>>>>>> 1. untarred
>>>>>> gfortran.com/download/x86_64/gcc-5-infrastructure.tar.xz
>>>>>> gfortran.com/download/x86_64/nightlies/gcc-trunk-20150202-r220340.tar.xz
>>>>>>
>>>>>> 2. added gcc5 infrastructure lib64 dir to LD_LIBRARY_PATH
>>>>>>
>>>>>> Compilation seems to work, but not linking:
>>>>>>
>>>>>> $ ./gcc5/gcc-trunk/bin/gfortran -c z.f90
>>>>>> $
>>>>>> $ ./gcc5/gcc-trunk/bin/gfortran z.f90
>>>>>> collect2: fatal error: cannot find 'ld'
>>>>>> compilation terminated.
>>>>>> $
>>>>>> $ which ld
>>>>>> /usr/bin/ld
>>>>>> $
>>>>>>
>>>>>
>>>>> Somehow the system ld is deemed unsuitable. No idea why.
>>>>> Last Autumn Jorge d'Elia reported the same, but communication while
>>>>> debugging faded out.
>>>>
>>>> Sorry. What I remember now is that I tried a couple of iterations but
>>>> without success, so I decided download all the gcc sources and re-compile
>>>> it. Although it takes a while, installation is ok. Anyway, if I get some
>>>> time, I will try to re-take it.
>>>>
>>>> Greetings.
>>>> Jorge.
>>
>> --
>> CIMEC (UNL-CONICET) Predio CONICET-Santa Fe, Colectora Ruta Nac 168,
>> Paraje El Pozo, S3000GLN Santa Fe, ARGENTINA, http://www.cimec.org.ar/
>> Tel +54 342 451.15.94/95 ext 1218, 1007, fax: +54-342-451.11.69
>



More information about the Fortran mailing list