From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matej Kupljen Date: Thu, 18 Aug 2005 10:42:57 +0200 Subject: [U-Boot-Users] Re: MIPS LE build problems In-Reply-To: <20050817080842.36E19353CFF@atlas.denx.de> References: <20050817080842.36E19353CFF@atlas.denx.de> Message-ID: <1124354577.13487.4.camel@localhost.localdomain> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi > So is there a clever way to "ask" gcc which endianess it's using? > I tried to come up with one but failed so far... I am searching how to do that. How about if the config.mk runs a little test program, like configure does? For example: #include #include int main(int argc, char **argv) { unsigned int data = 0x01234567; char *ptr = (char *)&data; if (ptr[0] == 0x01 && ptr[1] == 0x23 && ptr[2] == 0x45 && ptr[3] == 0x67) printf("big\n"); else if (ptr[3] == 0x01 && ptr[2] == 0x23 && ptr[1] == 0x45 && ptr[0] == 0x67) printf("little\n"); else printf("unknown\n"); return 0; } And then check the output of this program and decides to pass the -EL or -EB to LDFLAGS. Oh, do you know why I have to use the: -Wa,-allow_branch_to_undefined instead of: -Wa,-mips_allow_branch_to_undefined even though (I guess) I use the same patch as you do? And why don't you accept the patch that eliminates this patch to binutils? BR, Matej