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 09:28:14 +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>
Joseph Myers wrote:
> On Tue, 20 Oct 2015, Gary Benson wrote:
> > This commit adds make rules to build %.o and %.os files from %.i8
> > Infinity note source code.
> >
> > In order to ensure the correct preprocessor and assembler are used
> > for cross-builds the compilation is done in three stages. The target
> > preprocessor specified at ./configure time is used to preprocess the
> > %.i8 source; I8C consumes this preprocessed source and emits assembly
> > language; and finally the target assembler specified at ./configure
> > time is used to assemble the generated assembly language into object
> > code.
> >
> > I don't *think* the %.o and %.os files should differ (they don't
> > contain "real" code, just PT_NOTE sections) but please tell me if
> > I'm wrong and I will add a separate %.S -> %.os rule.
>
> On some platforms the options passed to GCC when compiling a .S file
> affect the options passed to the assembler, which in turn affects
> the ELF header (this applies e.g. to MIPS passing -KPIC). So I
> think you do need to compile the files separately.
Ok, I will change this.
> 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?
(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?)
For glibc is it ok if I add '-include sysdep.h' to the %.S -> %.o*
rules?
Thanks,
Gary
--
http://gbenson.net/