* Compiling newlib for the msp430x architecture
@ 2017-08-31 9:42 Stephan
2017-08-31 10:22 ` Nick Clifton
0 siblings, 1 reply; 4+ messages in thread
From: Stephan @ 2017-08-31 9:42 UTC (permalink / raw)
To: newlib
Hello,
I failed to compile newlib for with the msp430x architecture with 92kB
Flash.
Trying to compile newlib (in my case for the MSP430F2617) with the large
memory model (20bit pointers) failed for me because the Make-System
automatically injected the -mcpu=msp430 into the gcc flags. This gives
me the following warning:
> ../../../../../../newlib/libc/argz/dummy.c:1:0: warning: MCU
'msp430f2617' supports 430X ISA but -mcpu option is set to 430
because in order to get the large memory addressing instructions you
need to set -mlarge which requires the -mmcu=msp430f2617 option.
I tried to debug this as i thought it was my fault but it turns out that
some Makefile extracts the -mcpu=msp430 option from the
$ msp430-elf-gcc /* couple of -L and -B's */ --print-multi-lib
command. According to the GCC manpage this option is deprecated and
-mmcu= should be used instead.
I'm not sure if I am missing something here or if this is really a bug
in the make system which is why I am asking here.
Thanks, Stephan
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Compiling newlib for the msp430x architecture
2017-08-31 9:42 Compiling newlib for the msp430x architecture Stephan
@ 2017-08-31 10:22 ` Nick Clifton
[not found] ` <4f07c2da-6403-3bc6-1001-bc530a3a13e9@gmx.net>
0 siblings, 1 reply; 4+ messages in thread
From: Nick Clifton @ 2017-08-31 10:22 UTC (permalink / raw)
To: Stephan, newlib
Hi Stephan,
> I tried to debug this as i thought it was my fault but it turns out that some Makefile extracts the -mcpu=msp430 option from the
>
> $ msp430-elf-gcc /* couple of -L and -B's */ --print-multi-lib
Which Makefile does this ?
Cheers
Nick
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Compiling newlib for the msp430x architecture
[not found] ` <4f07c2da-6403-3bc6-1001-bc530a3a13e9@gmx.net>
@ 2017-08-31 11:11 ` Nick Clifton
[not found] ` <91640c20-98c4-0400-dab5-d5ec88303989@gmx.net>
0 siblings, 1 reply; 4+ messages in thread
From: Nick Clifton @ 2017-08-31 11:11 UTC (permalink / raw)
To: Stephan; +Cc: newlib
Hi Stephan,
> found it, it's config-ml.in, target (?) multi-do: line 491 (for me). Which results in the target multi-do: line 1246 in the build/msp430-elf/newlib/Makefile.
Ah - right - so you are trying to build newlib specifically for the 320F2617
but you are using a compiler that has been created with multilib support
enabled, so the config-ml.in script is trying to create separate builds for
each of the different multilibs supported by gcc.
Is there any reason why you want to build newlib specifically for the 320F2617 ?
Won't the generic -mlarge multilib version of the newlib just work for you ?
Cheers
Nick
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Compiling newlib for the msp430x architecture
[not found] ` <91640c20-98c4-0400-dab5-d5ec88303989@gmx.net>
@ 2017-09-01 12:01 ` Nick Clifton
0 siblings, 0 replies; 4+ messages in thread
From: Nick Clifton @ 2017-09-01 12:01 UTC (permalink / raw)
To: Stephan; +Cc: newlib
Hi Stephan,
> But I am not sure what you mean with the generic -mlarge multilib version. Is it automatically built alongside the -msmall (default i think) version?
Yes.
What should happen is that the compiler (gcc) should automatically choose
the correct version of the standard libraries to use when building your
application. So, suppose you compile a program with "-mmcu=msp430f2617 -mlarge"
specified on the command line, gcc should automatically recognise this as
requiring a -mlarge compatible version of the C library and select that version
when linking your program.
Different versions of the same library are held in different sub-directories of
the installation directory. So for example the -mlarge version of the C library
should be in the large/ sub-directory of /usr/lib. (Or wherever the libraries
have been installed). All of this should be transparent to the programmer. You
should not need to know about it. You just compile and link your application
and the correct libraries are automatically selected by the gcc driver.
The problem comes when you try to build your own version of these standard libraries.
Ideally you would just build them using the standard "configure ; make" process,
but for some reason you are trying to force a specific MCU selection and this is
causing the problems. And my question to you is - why are you trying to do this ?
> The compiler is the bare gcc toolchain from TI if that helps.
Does the toolchain from TI not come with the (multiple versions of the) C library
already built ?
Cheers
Nick
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-08-31 11:11 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-31 9:42 Compiling newlib for the msp430x architecture Stephan
2017-08-31 10:22 ` Nick Clifton
[not found] ` <4f07c2da-6403-3bc6-1001-bc530a3a13e9@gmx.net>
2017-08-31 11:11 ` Nick Clifton
[not found] ` <91640c20-98c4-0400-dab5-d5ec88303989@gmx.net>
2017-09-01 12:01 ` Nick Clifton
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).