From: Mike Frysinger <vapier@gentoo.org>
To: Esben Haabendal <esben.haabendal@dev.prevas.dk>
Cc: crossgcc@sourceware.org, "Yann E. MORIN" <yann.morin.1998@free.fr>
Subject: Re: [PATCH] kernel/linux: change arch tuple to use -uclinux for uclinux toolchains
Date: Tue, 25 Sep 2012 20:38:00 -0000 [thread overview]
Message-ID: <201209251637.44957.vapier@gentoo.org> (raw)
In-Reply-To: <87sja6kltt.fsf@arh128.prevas.dk>
[-- Attachment #1: Type: Text/Plain, Size: 4657 bytes --]
On Tuesday 25 September 2012 14:18:38 Esben Haabendal wrote:
> Mike Frysinger <vapier@gentoo.org> writes:
> > On Tuesday 25 September 2012 12:41:42 Yann E. MORIN wrote:
> >> Basically, 'bfin-elf' is for bare-metal, 'bfin-uclinux' if for
> >> flat-binaries with no shared libs, and 'bfin-linux' for FDPIC-ELF that
> >> allows shared libs.
> >
> > correct, the current convention is that "-uclinux" is for FLAT
> > targets.
>
> Ok, but where does this convention come from. Or rather, who follows
> this convention?
>
> It does not generally seem to be the convention used in GCC, at least
> not for all archs.
>
> If linux-gnu is linux with glibc, linux-uclibc is uClinux/FDPIC-ELF with
> uClibc, and uclinux-uclibc is uClinux/FLAT with uClibc.
uClibc supports multiple file formats (including FDPIC-ELF and FLAT). if you
see a toolchain end in "-uclinux" or "-uclibc*", you're pretty much guaranteed
to be using uClibc.
further, pretty much every target i've seen so far that ends in -uclinux was
targeting the FLAT file format. for Blackfin targets, we wanted a new tuple
when using FDPIC-ELF, so we went with linux-uclibc rather than uclinux. after
all, when you're running Linux with the ELF format, the fact that you lack a
MMU is largely transparent to userland (ignoring lack of fork).
> What arch tuple should then be used for linux with uClibc? I don't see the
> benefit of not being able to tell it apart from uClinux/FDPIC-ELF with
> uClibc.
i don't understand the question. "uclinux" means you're running Linux with
uClibc, as does "linux-uclibc".
> --------
> m68k-*-uclinuxoldabi*) # Motorola m68k/ColdFire running uClinux
> # with uClibc, using the original
> # m68k-elf-based ABI
> default_m68k_cpu=68020
> default_cf_cpu=5206
> tm_file="${tm_file} m68k/m68k-none.h m68k/m68kelf.h dbxelf.h
> elfos.h m68k/uclinux-oldabi.h glibc-stdint.h" tm_defines="${tm_defines}
> MOTOROLA=1"
> tmake_file="m68k/t-floatlib m68k/t-uclinux"
> ;;
> m68k-*-uclinux*) # Motorola m68k/ColdFire running uClinux
> # with uClibc, using the new
> GNU/Linux-style # ABI.
> default_m68k_cpu=68020
> default_cf_cpu=5206
> tm_file="${tm_file} dbxelf.h elfos.h svr4.h linux.h glibc-stdint.h
> flat.h m68k/linux.h m68k/uclinux.h ./sysroot-suffix.h"
> tm_defines="${tm_defines} MOTOROLA=1 UCLIBC_DEFAULT=1"
> extra_options="${extra_options} linux.opt"
> tmake_file="m68k/t-floatlib m68k/t-uclinux m68k/t-mlibs"
> ;;
> m68k-*-linux*) # Motorola m68k's running GNU/Linux
> # with ELF format using glibc 2
> # aka the GNU/Linux C library 6.
> default_m68k_cpu=68020
> default_cf_cpu=5475
> with_arch=${with_arch:-m68k}
> tm_file="${tm_file} dbxelf.h elfos.h svr4.h linux.h glibc-stdint.h
> m68k/linux.h ./sysroot-suffix.h" extra_options="${extra_options}
> m68k/ieee.opt"
> tm_defines="${tm_defines} MOTOROLA=1"
> tmake_file="${tmake_file} m68k/t-floatlib m68k/t-linux
> m68k/t-mlibs" # if not configured with --enable-sjlj-exceptions, bump the
> # libgcc version number
> if test x$sjlj != x1; then
> tmake_file="$tmake_file m68k/t-slibgcc-elf-ver"
> fi
> ;;
> --------
>
> I guess that mean that at least for m68k, the convention you mention is
> not shared with GCC.
m68k doesn't support FDPIC-ELF. i don't know what you're trying to show.
> When building an m68k cross gcc, using *-*-linux-* will filter out any
> target devices that does not have the FL_MMU flag set (in
> gcc/config/m68k/m68k-devices.def). When building with *-*-uclinux-*,
> only those devices without FL_MMU flag set, or with FL_UCLINUX flag set
> will be available.
>
> As such, the convention does not work for m68k.
>
> As for my current needs, this can be made conditional for m68k.
>
> That said, I don't think the convention is the most sane one, as it
> would be best to have "linux-uclibc" mean the same thing independent of
> the cpu prefix, and also in line with the principle of least surprise,
> it would make sense to use "uclinux-*" for uclinux archs :-)
looks to me like gcc only uses the FL_{MMU,UCLINUX} flags to figure out whether
to build FLAT shared libraries. so if you want those things, use m68k-
uclinux. if you don't want those things, then use whatever target you want.
-mike
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
next prev parent reply other threads:[~2012-09-25 20:38 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-25 12:30 Esben Haabendal
2012-09-25 16:42 ` Yann E. MORIN
2012-09-25 16:46 ` Mike Frysinger
2012-09-25 18:18 ` Esben Haabendal
2012-09-25 20:38 ` Mike Frysinger [this message]
2012-09-25 21:18 ` Esben Haabendal
2012-09-26 2:33 ` Mike Frysinger
2012-09-26 4:47 ` Esben Haabendal
2012-09-26 5:26 ` Mike Frysinger
2012-09-26 6:38 ` Esben Haabendal
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201209251637.44957.vapier@gentoo.org \
--to=vapier@gentoo.org \
--cc=crossgcc@sourceware.org \
--cc=esben.haabendal@dev.prevas.dk \
--cc=yann.morin.1998@free.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).