This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [RFC][PATCH 21/22] Add Makerules to build %.o and %.os from %.i8
- From: Gary Benson <gbenson at redhat dot com>
- To: Joseph Myers <joseph at codesourcery dot com>
- Cc: libc-alpha at sourceware dot org
- Date: Wed, 21 Oct 2015 16:00:16 +0100
- Subject: Re: [RFC][PATCH 21/22] Add Makerules to build %.o and %.os from %.i8
- Authentication-results: sourceware.org; auth=none
- References: <1445352975-17844-1-git-send-email-gbenson at redhat dot com> <1445352975-17844-22-git-send-email-gbenson at redhat dot com> <alpine dot DEB dot 2 dot 10 dot 1510201525580 dot 7944 at digraph dot polyomino dot org dot uk> <20151021082814 dot GC13381 at blade dot nx> <alpine dot DEB dot 2 dot 10 dot 1510211202440 dot 11233 at digraph dot polyomino dot org dot uk>
Joseph Myers wrote:
> On Wed, 21 Oct 2015, Gary Benson wrote:
> > Joseph Myers wrote:
> > > On some platforms, even assembler files with no actual code need
> > > to contain certain assembler directives to be ABI-compatible
> > > with those generated by the compiler. In particular, this
> > > applies to ARM; see the .eabi_attribute directives in
> > > sysdeps/arm/sysdep.h. If generating a .S file, you should make
> > > sure it includes <sysdep.h> so that such directives are present.
> >
> > I did not know that. Is this because all glibc files include this
> > file with the directives?
>
> Almost all .S files include <sysdep.h> to use its macros for
> defining functions etc. - and where they do not, special measures
> are needed on ARM (see sysdeps/arm/abi-note.S adding these
> attributes and then including csu/abi-note.S). Including <sysdep.h>
> in generated .S files is the simplest way of ensuring such
> directives are present when required.
>
> > (I guess what I'm asking is, in general, if I have a .c file and a
> > .S file with no special directives, can I compile and link them
> > and expect it to work?)
>
> Not without these directives on ARM.
Yuck. Is there any generic way of obtaining the required directives
for the host system? Can I obtain them from GCC somehow? I saw that
sysdep.h doesn't get installed.
I'll update Makerules to use '-include sysdep.h' to build for GLIBC
because it may not be building for the host system, but I'm trying to
figure out a way for standalone I8C to handle this properly
(i.e. without emitting some kind of "#ifdef ARM..." boilerplate).
Cheers,
Gary
--
http://gbenson.net/