Building uclibc for big-endian and little-endian target.

Sedat Dilek sedat.dilek at gmail.com
Wed Oct 16 08:29:01 UTC 2013


On Wed, Oct 16, 2013 at 10:23 AM, Sedat Dilek <sedat.dilek at gmail.com> wrote:
> On Wed, Oct 16, 2013 at 9:04 AM, Mike Frysinger <vapier at gentoo.org> wrote:
>> On Tuesday 15 October 2013 15:00:40 Khem Raj wrote:
>>> On Oct 15, 2013, at 10:30 AM, Steve Ellcey wrote:
>>> > I have a question about endiness and uclibc.  I am trying to build
>>> > multiple versions of uclibc for MIPS, including big and little endian
>>> > versions.  What I notice is that in Rules.mak there are lines:
>>> >
>>> > CPU_LDFLAGS-$(ARCH_LITTLE_ENDIAN) += -Wl,-EL
>>> > CPU_LDFLAGS-$(ARCH_BIG_ENDIAN)    += -Wl,-EB
>>> >
>>> > to add -EL or -EB to linker commands (this seems to be generic for all
>>> > architectures).
>>> >
>>> > What I do not see is any generic (or MIPS specific) code to add -EL or
>>> > -EB to CPU_CFLAGS (or CPU_FLAGS-y to be exact).  I am wondering if there
>>> > is a specific reason for this?  Right now the uclibc build seems to
>>> > assume that the compiler I am using to build uclibc will always generate
>>> > the correct endiness without any flags.
>>>
>>> That was consensus we had some time ago. Otherwise these flags were getting
>>> too many and difficult to deal with.
>>
>> well, i think that was more focused on cpu/arch/tune flags.  we still have
>> endian flags in there for various targets.  adding the right logic for mips
>> would be OK imo.
>
> As the Freetz router project had to deal with BE/LE issues, we (yes, I
> was more active these days) decided to define the Kconfig logic in:
>
>      extra/Configs/Config.mips
>
> ...and added the the CPU_FLAGS-* (CPU optimization etc.) stuff to...
>
>      Rules.mak
>
> Please see the patch in [1] for more details.
>
> - Sedat -
>
> [1] http://freetz.org/browser/trunk/toolchain/make/target/uclibc/0.9.33.2/100-fritzbox_specific_arch_flags.freetz.patch

Just two details...

Freetz supports mostly MIPS based router boxes.

2nd, check which minimum gcc-version supports certain CPU/arch flags
(some projects still uses ancient gcc in their toolchains) :-)!

- Sedat -


More information about the uClibc mailing list