LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 02-26-2020, 07:09 PM   #1
Sylvester Ink
Member
 
Registered: Jun 2010
Distribution: Slackware
Posts: 112

Rep: Reputation: 35
Error When Cross-Compiling for Arm Using Newlib Nano Libs


I'm trying to build an Arm project using the arm-gcc cross compiler along with the libraries in the newlib package. It builds just fine, but when it comes to linking, I get the following error:
Code:
/usr/bin/arm-none-eabi-ld: cannot find -lg_nano
/usr/bin/arm-none-eabi-ld: cannot find -lstdc++_nano
/usr/bin/arm-none-eabi-ld: cannot find -lc_nano
/usr/bin/arm-none-eabi-ld: cannot find -lc_nano
I am using the following linker flag:
Code:
-specs=nano.specs
This is to use the libraries optimized to be smaller and lighter for embedded devices. If I remove that particular flag, it builds just fine.

Both arm-gcc and newlib are from Slackbuilds.org, and the arm-gcc Slackbuild script has been altered to add support for the c++ language.

Is newlib compiled without nano support? If that's the case, why is the nano.specs file available in the package? Also, what would I need to change in the Slackbuild in order for newlib to be built with support?
 
Old 02-27-2020, 03:45 PM   #2
philanc
Member
 
Registered: Jan 2011
Posts: 308

Rep: Reputation: 273Reputation: 273Reputation: 273
Quote:
Originally Posted by Sylvester Ink View Post
I'm trying to build an Arm project using the arm-gcc cross compiler along with the libraries in the newlib package. It builds just fine, but when it comes to linking, I get the following error:
Code:
/usr/bin/arm-none-eabi-ld: cannot find -lg_nano
/usr/bin/arm-none-eabi-ld: cannot find -lstdc++_nano
/usr/bin/arm-none-eabi-ld: cannot find -lc_nano
/usr/bin/arm-none-eabi-ld: cannot find -lc_nano
I am using the following linker flag:
Code:
-specs=nano.specs
This is to use the libraries optimized to be smaller and lighter for embedded devices. If I remove that particular flag, it builds just fine.

Both arm-gcc and newlib are from Slackbuilds.org, and the arm-gcc Slackbuild script has been altered to add support for the c++ language.

Is newlib compiled without nano support? If that's the case, why is the nano.specs file available in the package? Also, what would I need to change in the Slackbuild in order for newlib to be built with support?
As far as I know, 'nano' is not a build option for newlib, but a distinct libc named "newlib-nano" initially provided by ARM Ltd in their cross development toolchain.

I don't think that the newlib package from SBo can build newlib-nano. In the newlib tree, what nano.spec file did you use?

On the other hand, there may be a way to build newlib with the newlib/libc/stdio/nano_xxx files (vfprintf and others) to reduce the libc size but I don't know how to do it.
 
Old 02-28-2020, 02:05 AM   #3
Sylvester Ink
Member
 
Registered: Jun 2010
Distribution: Slackware
Posts: 112

Original Poster
Rep: Reputation: 35
Quote:
Originally Posted by philanc View Post
As far as I know, 'nano' is not a build option for newlib, but a distinct libc named "newlib-nano" initially provided by ARM Ltd in their cross development toolchain.

I don't think that the newlib package from SBo can build newlib-nano. In the newlib tree, what nano.spec file did you use?

On the other hand, there may be a way to build newlib with the newlib/libc/stdio/nano_xxx files (vfprintf and others) to reduce the libc size but I don't know how to do it.
That's odd, because the newlib package from SBo contains the nano.specs file.
Code:
/usr/arm-none-eabi/lib/nano.specs
/usr/arm-none-eabi/lib/thumb/nano.specs
/usr/arm-none-eabi/lib/thumb/autofp/v7/fpu/nano.specs
/usr/arm-none-eabi/lib/arm/autofp/v5te/fpu/nano.specs
I'm pretty sure I was using the first one, though all four are the same:
Code:
%rename link                nano_link
%rename link_gcc_c_sequence                nano_link_gcc_c_sequence
%rename cpp_unique_options              nano_cpp_unique_options
 
*cpp_unique_options:
-isystem =/include/newlib-nano %(nano_cpp_unique_options)
 
*nano_libc:
-lc_nano
 
*nano_libgloss:
%{specs=rdimon.specs:-lrdimon_nano} %{specs=nosys.specs:-lnosys}
 
*link_gcc_c_sequence:
%(nano_link_gcc_c_sequence) --start-group %G %(nano_libc) %(nano_libgloss) --end-group
 
*link:
%(nano_link) %:replace-outfile(-lc -lc_nano) %:replace-outfile(-lg -lg_nano) %:replace-outfile(-lrdimon -lrdimon_nano) %:replace-outfile(-lstdc++ -lstdc++_nano) %:replace-outfile(-lsupc++ -lsupc++_nano)
 
*lib:
%{!shared:%{g*:-lg_nano} %{!p:%{!pg:-lc_nano}}%{p:-lc_p}%{pg:-lc_p}}
I've seen it mentioned elsewhere that newlib can be built with nano, though it's hard to find consistent configure flags that do it.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
configure error while cross compiling gstreamer for arm divya s Programming 2 11-23-2011 05:01 AM
Old libs, New libs bomelia Linux - Software 7 09-29-2010 09:59 AM
cross compiling of libfame-0.9.1 using arm lynux Gcc keerti.torvi Linux - Newbie 1 06-26-2009 11:36 AM
link-time libs need to be run0time libs says curl's make install UniquelyAm Linux - Software 0 06-09-2007 01:40 AM
NEWLIB vs GLIBC MKSrivastava Linux - General 1 04-19-2007 05:44 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 03:25 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration