This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] GNU/k*BSD support (with ChangeLog) for gcc
- From: "David O'Brien" <obrien at FreeBSD dot org>
- To: Robert Millan <zeratul2 at wanadoo dot es>
- Cc: gcc-patches at gcc dot gnu dot org, glibc-bsd-hackers at nongnu dot org
- Date: Fri, 19 Mar 2004 08:13:14 -0800
- Subject: Re: [PATCH] GNU/k*BSD support (with ChangeLog) for gcc
- Organization: The NUXI BSD Group
- References: <20040315022155.GA2370@aragorn>
- Reply-to: obrien at FreeBSD dot org
On Mon, Mar 15, 2004 at 03:21:55AM +0100, Robert Millan wrote:
> The attached patch rewrites GNU/kFreeBSD support so that it shares common
> definitions with GNU/Linux and only adds minimal changes, resulting in
> much better integration (both externaly and wrt gcc internals). It does
> also add GNU/kNetBSD.
...
> diff -Nur gcc.old/gcc/config/freebsd-spec.h gcc/gcc/config/freebsd-spec.h
> --- gcc.old/gcc/config/freebsd-spec.h 2004-02-04 21:00:52.000000000 +0100
> +++ gcc/gcc/config/freebsd-spec.h 2004-03-13 23:03:41.000000000 +0100
> @@ -61,6 +61,7 @@
> builtin_define ("__FreeBSD__=3"); \
> else \
> builtin_define ("__FreeBSD__"); \
> + builtin_define ("__FreeBSD_kernel__"); \
> builtin_define_std ("unix"); \
> builtin_define ("__KPRINTF_ATTRIBUTE__"); \
> builtin_assert ("system=unix"); \
I respectfully really, really don't like this. This is a
FreeBSD-specific file and the FreeBSD developers shouldn't have to be
careful about what symbols we start using in our kernel. The
GNU/kFreeBSD bits should remain in separate files that won't get in the
way of FreeBSD's evolution. Is it is really too hard to maintain things
they way they are now?
> -#define LINK_SPEC "-m elf_i386 %{shared:-shared} \
> +#define LINK_SPEC "-m " LINK_EMULATION " %{shared:-shared} \
Rather than depend on ANSI-C string concatenation, why not do it right
and create %(link_emulation).
> - %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
> + %{!dynamic-linker:-dynamic-linker " LINK_LDPATH "}} \
Ditto. See how I already implemented this in gcc/config/freebsd-spec.h
and gcc/config/i386/freebsd.h with %(fbsd_dynamic_linker). We could
easily change this to just %(dynamic_linker) for constancy w/in GCC.
--
-- David (obrien@FreeBSD.org)