This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
RE: [patch, libgloss] Create nosys.specs
- From: "Joey Ye" <joey dot ye at arm dot com>
- To: <newlib at sourceware dot org>
- Cc: "Joey Ye" <Joey dot Ye at arm dot com>
- Date: Tue, 17 Sep 2013 16:58:20 +0800
- Subject: RE: [patch, libgloss] Create nosys.specs
- Authentication-results: sourceware.org; auth=none
- References: <000001ceafc9$75dc1d10$61945730$ at arm dot com> <CAL0py25P=u9Y_9UbTCcm14idnW+Se=g7oM8zu9b+ZVNqOoYiYw at mail dot gmail dot com>
Ping
> -----Original Message-----
> From: Ye Joey [mailto:joey.ye.cc@gmail.com]
> Sent: Tuesday, September 17, 2013 16:57
> To: Joey Ye
> Subject: Re: [patch, libgloss] Create nosys.specs
>
> On Thu, Sep 12, 2013 at 11:04 PM, Joey Ye <joey.ye@arm.com> wrote:
> > Bare-metal toolchain users often run into missing libgloss symbols
problem.
> > The typical reason is that -lnosys isn't given in the right place. For
> > example:
> >
> > # this works
> > $ arm-none-eabi-gcc a.o -lc -lnosys -o a.axf
> >
> > # putting object file at end of option, it doesn't work $
> > arm-none-eabi-gcc -lc -lnosys -o a.axf a.o
> > libc.a(lib_a-sbrkr.o): In function `_sbrk_r':
> > sbrkr.c:(.text._sbrk_r+0x12): undefined reference to `_sbrk'
> >
> > This patch introduces nosys.specs to group -lnosys with -lc, which is
> > quite similar to rdimon.specs. With this patch, following simple
> > command line will
> > work:
> > $ arm-none-eabi-gcc -specs=nosys.specs -o a.axf a.o
> >
> > OK to trunk?
> >
> > ChangeLog:
> > libnosys/Makefile.in: install nosys.specs.
> > libnosys/nosys.specs: New specs.
> >
> > diff --git a/libgloss/libnosys/Makefile.in
> > b/libgloss/libnosys/Makefile.in index ff4c416..22828a4 100644
> > --- a/libgloss/libnosys/Makefile.in
> > +++ b/libgloss/libnosys/Makefile.in
> > @@ -77,6 +77,7 @@ GCC_LDFLAGS = `if [ -d ${objroot}/../gcc ] ; \
> > then echo -L${objroot}/../gcc ; fi`
> >
> > OUTPUTS = libnosys.a
> > +SPECS = ${srcdir}/nosys.specs
> >
> > # Host specific makefile fragment comes in here.
> > @host_makefile_frag@
> > @@ -101,7 +102,7 @@ distclean maintainer-clean realclean: clean
> >
> > .PHONY: install info install-info clean-info
> > install:
> > - @for outputs in ${OUTPUTS}; do\
> > + @for outputs in ${OUTPUTS} ${SPECS}; do\
> > mkdir -p $(DESTDIR)$(tooldir)/lib${MULTISUBDIR}; \
> > $(INSTALL_DATA) $${outputs}
> > $(DESTDIR)$(tooldir)/lib${MULTISUBDIR};
> > \
> > done
> > diff --git a/libgloss/libnosys/nosys.specs
> > b/libgloss/libnosys/nosys.specs new file mode 100644 index
> > 0000000..dffc28d
> > --- /dev/null
> > +++ b/libgloss/libnosys/nosys.specs
> > @@ -0,0 +1,7 @@
> > +%rename lib libc
> > +
> > +*libgloss:
> > +-lnosys
> > +
> > +*lib:
> > +--start-group %(libc) %(libgloss) --end-group
> >
> >
> >