Hi Steve On Oct 15, 2013, at 10:30 AM, Steve Ellcey <sell...@mips.com> 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. > I want to build big and little endian uclibc's > using a single cross compiler that is capable of generating both big and > little endian objects given a -EL or a -EB. > > I know I can work around this by adding -EL or -EB to UCLIBC_EXTRA_CFLAGS > when building but I am wondering why Rules.mak doesn't have: > > CPU_CFLAGS-$(ARCH_LITTLE_ENDIAN) += -EL > CPU_CFLAGS-$(ARCH_BIG_ENDIAN) += -EB > > If not for all CPU's, at least for MIPS and other bi-endian architectures. As you pointed its specific to certain CPUs. > > How do other architectures handle building multiple uclibc libraries with > different endiness settings? Configure the toolchain and if you want additional tweaks then pass them via UCLIBC_EXTRA_CFLAGS _______________________________________________ uClibc mailing list uClibc@uclibc.org http://lists.busybox.net/mailman/listinfo/uclibc