Properly building newlib to install spec files

Mojca Miklavec mojca@macports.org
Mon Oct 21 06:45:00 GMT 2019


Dear Orlando,

I'm still waiting for the TI website to come back online to be able to
install some dependencies before building msp430-gcc:
    http://software-dl.ti.com/msp430/msp430_public_sw/mcu/msp430/MSPGCC/latest/exports/
so I'm not yet able to actually test msp430, but the change definitely
helped with getting those targets working for arm-none-eabi-gcc and a
couple of other cross-compilers where we were also missing them.

I've seen some people proposing using --with-libgloss, but the build
worked for me automatically even without providing that flag, so I'm
not exactly sure when that is needed. I'll add it "just in case".

You links seem to hint in fact that these files might not be installed
for msp430, but let's first see what I get ...

Thank you very much for all the hints and links,
    Mojca

[*] https://github.com/macports/macports-ports/pull/5584

On Sun, 20 Oct 2019 at 21:21, Orlando Arias <orlandoarias@gmail.com> wrote:
>
> Greetings,
>
> I was under the impression that the nosys.specs file was no longer provided for the msp430-elf target in light of the CIO interface being added [1][2]. Please correct me if I'm wrong on this.
>
> Cheers,
> Orlando.
>
> [1] https://sourceware.org/ml/newlib/2015/msg00926.html
> [2] https://sourceware.org/ml/newlib/2015/msg00923.html
>
> On October 20, 2019 3:40:17 PM UTC, Mojca Miklavec <mojca@macports.org> wrote:
>>
>> Hi,
>>
>> I'm sorry for replying after such a long time, but I could not exactly
>> figure out what I was doing wrong until Joel today pointed out a dirty
>> simple little trick: I just had to make a symlink from gcc sources to
>> libgloss in order to install all the spec files ... and that solution
>> automatically worked, without the need to rebuild gcc the second time
>> (which would cause me a lot of headaches both in terms of
>> bootstrapping and compile times).
>>
>> So basically just a matter of
>>     cd gcc-9.2.0
>>     ln -s ../newlib-3.1.0/libgloss .
>>
>> We were already using
>>     ln -s ../newlib-3.1.0/newlib .
>> just not the libgloss thing.
>>
>> It would be awesome if this was documented somewhere for complete newbies :)
>>
>> I'll update all our cross-compilers to fix this.
>>
>> Thank you very much,
>>     Mojca
>>
>> On Mon, 7 Jan 2019 at 21:50, Jeff Johnston <jjohnstn@redhat.com> wrote:
>>>
>>>
>>>  If you build and install the various components to the same installation directory, it should just work.
>>>
>>>  See: https://gist.github.com/resetnow/1b55beed32f3eb3f90513896565ef5c0
>>>
>>>  (your gcc compiler config options may vary)
>>>
>>>  If a spec file is installed somewhere else, you can use the -B option on the compile to specify a location for gcc to look for it.
>>>
>>>  -- Jeff J.
>>>
>>>  On Sat, Jan 5, 2019 at 4:20 PM Mojca Miklavec <mojca@macports.org> wrote:
>>>>
>>>>
>>>>  Hi,
>>>>
>>>>  I'm fixing some packages for a package manager. I think I have a bunch
>>>>  of various working gcc crosscompilers, but if I try to test something
>>>>  like
>>>>
>>>>  $ msp430-elf-gcc -mmcu=msp430g2211 -specs=nosys.specs -o test.elf test.c
>>>>  msp430-elf-gcc: error: nosys.specs: No such file or directory
>>>>
>>>>  apparently the specs files are missing.
>>>>
>>>>  I'm creating a symlink from gcc to newlib and build gcc with
>>>>  --with-newlib, but apparently the files don't get installed. I noticed
>>>>  that random instructions suggest separately building:
>>>>  - first gcc
>>>>  - then newlib
>>>>  - then gcc again
>>>>  http://www.ifp.illinois.edu/~nakazato/tips/xgcc.html#gccagain
>>>>
>>>>  while other instructions say to use just --with-newlib.
>>>>
>>>>  Can you please advise me how to build newlib in a proper way, so that
>>>>  the spec files will be installed? Where should they usually end up?
>>>>
>>>>  Thank you very much,
>>>>      Mojca
>
>
> --
> Sent from my Android device with K-9 Mail. Please excuse my brevity.



More information about the Newlib mailing list