Skip to contentSkip to conversation

toolchain/gcc/Config.in broken

Buildroot Bernhard Fischer 3 participants 12 messages Oct 9, 2007 – Oct 10, 2007 2 messages not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 1 line · Shinya Kuribayashi

Although I specified O32 and mips32r2 in menuconfig, gcc-4.2.1-initial/

You probably mean OABI and not O32.

Quoted 14 lines

config.status says --with-abi=o64.

# /home/skuribay/devel/buildroot/toolchain_build_mips/gcc-4.2.1/configure   
--prefix=/home/skuribay/devel/buildroot/build_mips/staging_dir/usr 
--build=i386-pc-linux-gnu --host=i386-pc-linux-gnu 
--target=mips-linux-uclibc 
--with-sysroot=/home/skuribay/devel/buildroot/toolchain_build_mips/uClibc_dev/ 
--disable-__cxa_atexit --enable-target-optspace --with-gnu-ld 
--disable-shared 
--with-gmp=/home/skuribay/devel/buildroot/toolchain_build_mips/gmp 
--with-mpfr=/home/skuribay/devel/buildroot/toolchain_build_mips/mpfr 
--disable-nls --enable-threads --disable-multilib --with-abi=o64 
--with-tune=mips32r2 --enable-languages=c
Quoted 1 line

Is this right? I thought --with-abi=32 expected.

Look at target/Config.in.arch
I was under the impression that OABI was 32 for mipsel and o64 for mips, no?

Quoted 1 line

I'm not familiar with buildroot so much. I might miss something.

I'm not too familiar with the mips matrix.. I will take a look how mips32r2 should be configured (mips vs. mips64 vs. mipsel vs. ??; i.e. both the endianess and the bit-depth have to be settable, AFAICS).

Thanks for the heads up.
cheers,

#2 lore raw
Quoted 1 line · Bernhard Fischer

You probably mean OABI and not O32.

Yes :-)

Quoted 3 lines

Look at target/Config.in.arch
I was under the impression that OABI was 32 for mipsel and o64 for mips, no?

I'm not confident about that...

Quoted 3 lines

I'm not too familiar with the mips matrix.. I will take a look how mips32r2 should be configured (mips vs. mips64 vs. mipsel vs. ??; i.e. both the endianess and the bit-depth have to be settable, AFAICS).

IMHO it's target ABI config problem about OABI and mips, not mips32r2 specific problem as you know.

I have three successful builds. I hope these help.

[1] mips: Before recently toolchain config rework (2007-09-19 build)

skuribay at debian:~/devel/buildroot$ ./build_mips.orig/staging_dir/usr/bin/mips-linux-gcc -v
Using built-in specs.
Target: mips-linux-uclibc
Configured with: /home/skuribay/devel/buildroot/toolchain_build_mips/gcc-4.2.1/configure --prefix=/usr --build=i386-pc-linux-gnu --host=i386-pc-linux-gnu --target=mips-linux-uclibc --enable-languages=c,c++ --with-sysroot=/home/skuribay/devel/buildroot/build_mips/staging_dir --with-build-time-tools=/home/skuribay/devel/buildroot/build_mips/staging_dir/usr/mips-linux-uclibc/bin --disable-__cxa_atexit --enable-target-optspace --with-gnu-ld --enable-shared --with-gmp=/home/skuribay/devel/buildroot/toolchain_build_mips/gmp --with-mpfr=/home/skuribay/devel/buildroot/toolchain_build_mips/mpfr --disable-nls --enable-threads --disable-multilib Thread model: posix
gcc version 4.2.1

[2] mipsel: Current trunk build

skuribay at debian:~/devel/buildroot$ ./build_mipsel/staging_dir/usr/bin/mipsel-linux-gcc -v
Using built-in specs.
Target: mipsel-linux-uclibc
Configured with: /home/skuribay/devel/buildroot/toolchain_build_mipsel/gcc-4.2.1/configure --prefix=/usr --build=i386-pc-linux-gnu --host=i386-pc-linux-gnu --target=mipsel-linux-uclibc --enable-languages=c,c++ --with-sysroot=/home/skuribay/devel/buildroot/build_mipsel/staging_dir --with-build-time-tools=/home/skuribay/devel/buildroot/build_mipsel/staging_dir/usr/mipsel-linux-uclibc/bin --disable-__cxa_atexit --enable-target-optspace --with-gnu-ld --enable-shared --with-gmp=/home/skuribay/devel/buildroot/toolchain_build_mipsel/gmp --with-mpfr=/home/skuribay/devel/buildroot/toolchain_build_mipsel/mpfr --disable-nls --enable-threads --disable-multilib --with-abi=32 --with-tune=mips32r2 Thread model: posix
gcc version 4.2.1

[3] mips: Current trunk build with a change (for testing)

skuribay at debian:~/devel/buildroot$ svn diff

Config.in.arch (working copy) renamed from Config.in.arch (revision 20207) +1 -1
Index: target/Config.in.arch
===================================================================
@@ -689,7 +689,7 @@
        default iwmmxt          if BR2_iwmmxt
        default 32              if BR2_mipsel && BR2_MIPS_OABI
        default n32             if BR2_mipsel && BR2_MIPS_EABI
-       default o64             if BR2_mips && BR2_MIPS_OABI
+       default 32              if BR2_mips && BR2_MIPS_OABI
        default eabi            if BR2_mips && BR2_MIPS_EABI
        default 64              if BR2_mips && BR2_MIPS_ABI64
        default mmixware        if BR2_mmix && BR2_MMIX_ABI_native

skuribay at debian:~/devel/buildroot$ ./build_mips/staging_dir/usr/bin/mips-linux-gcc -v
Using built-in specs.
Target: mips-linux-uclibc
Configured with: /home/skuribay/devel/buildroot/toolchain_build_mips/gcc-4.2.1/configure --prefix=/usr --build=i386-pc-linux-gnu --host=i386-pc-linux-gnu --target=mips-linux-uclibc --enable-languages=c,c++ --with-sysroot=/home/skuribay/devel/buildroot/build_mips/staging_dir --with-build-time-tools=/home/skuribay/devel/buildroot/build_mips/staging_dir/usr/mips-linux-uclibc/bin --disable-__cxa_atexit --enable-target-optspace --with-gnu-ld --enable-shared --with-gmp=/home/skuribay/devel/buildroot/toolchain_build_mips/gmp --with-mpfr=/home/skuribay/devel/buildroot/toolchain_build_mips/mpfr --disable-nls --enable-threads --disable-multilib --with-abi=32 --with-tune=mips32r2 Thread model: posix
gcc version 4.2.1

Component versions are same for all three:
- binutils-2.18.50.1
- gcc-4.2.1
- gmp-4.2.2
- linux-2.6.22.1
- mpfr-2.3.0
- uClibc-0.9.29

thanks,

Shinya Kuribayashi

#3 lore raw
Quoted 31 lines · Shinya Kuribayashi
Quoted 1 line · Bernhard Fischer

You probably mean OABI and not O32.

Yes :-)

Quoted 3 lines

Look at target/Config.in.arch
I was under the impression that OABI was 32 for mipsel and o64 for mips, no?

I'm not confident about that...

Quoted 3 lines

I'm not too familiar with the mips matrix.. I will take a look how mips32r2 should be configured (mips vs. mips64 vs. mipsel vs. ??; i.e. both the endianess and the bit-depth have to be settable, AFAICS).

IMHO it's target ABI config problem about OABI and mips, not mips32r2 specific problem as you know.

I have three successful builds. I hope these help.

[1] mips: Before recently toolchain config rework (2007-09-19 build)

skuribay at debian:~/devel/buildroot$ ./build_mips.orig/staging_dir/usr/bin/mips-linux-gcc -v Using built-in specs.
Target: mips-linux-uclibc
Configured with:
/home/skuribay/devel/buildroot/toolchain_build_mips/gcc-4.2.1/configure --prefix=/usr --build=i386-pc-linux-gnu --host=i386-pc-linux-gnu --target=mips-linux-uclibc --enable-languages=c,c++ --with-sysroot=/home/skuribay/devel/buildroot/build_mips/staging_dir

Quoted 8 lines

--with-build-time-tools=/home/skuribay/devel/buildroot/build_mips/staging_dir/usr/mips-linux-uclibc/bin --disable-__cxa_atexit --enable-target-optspace --with-gnu-ld
--enable-shared
--with-gmp=/home/skuribay/devel/buildroot/toolchain_build_mips/gmp --with-mpfr=/home/skuribay/devel/buildroot/toolchain_build_mips/mpfr
--disable-nls --enable-threads --disable-multilib
Thread model: posix
gcc version 4.2.1

I don't know offhand what abi that defaults to. Can you check this, perhaps?

Quoted 2 lines

[2] mipsel: Current trunk build

[snip mipsel OABI is fine]

Quoted 9 lines

[3] mips: Current trunk build with a change (for testing)

skuribay at debian:~/devel/buildroot$ svn diff
Index: target/Config.in.arch
===================================================================

Config.in.arch (working copy) line 692

Quoted 5 lines
Config.in.arch (working copy) renamed from Config.in.arch (revision 20207) +1 -1
@@ -689,7 +689,7 @@
       default iwmmxt          if BR2_iwmmxt
       default 32              if BR2_mipsel && BR2_MIPS_OABI
       default n32             if BR2_mipsel && BR2_MIPS_EABI
-       default o64             if BR2_mips && BR2_MIPS_OABI
+       default 32              if BR2_mips && BR2_MIPS_OABI

I'm pretty sure that this is not really correct either.
I will extend these (for mips) to include "ABI32" which boils down to 32.
But think about your change for a second. For mips EB you want to allow for 32bit (1,2,32*) and 64bit where 32bit OABI should use =32 but 64bit OABI should use =o64 as opposed to 64bit ABI32 (=32), 64bit EABI (=eabi), 64bit ABI64 (=64), at least AFAICT.

Does this sound appropriate to you?

#4 lore raw
Quoted 1 line · Bernhard Fischer
Quoted 1 line

[1] mips: Before recently toolchain config rework (2007-09-19 build)

<snip>

Quoted 2 lines

I don't know offhand what abi that defaults to. Can you check this, perhaps?

Yes, confirmed with r19885 (2007-09-18).
At that time, we used to configure ABI and ISA as a uClibc config, right? I always configured O32 ABI and MIPS32, no doubt:

*
* Target Architecture Features and Options
*
Target ABI

Quoted 1 line

1. O32 ABI (CONFIG_MIPS_O32_ABI) (NEW)

2. N32 ABI (CONFIG_MIPS_N32_ABI) (NEW)
3. N64 ABI (CONFIG_MIPS_N64_ABI) (NEW)
choice[1-3?]: 1
Target Processor Architecture

Quoted 1 line

1. Generic (MIPS I) (CONFIG_MIPS_ISA_1) (NEW)

2. MIPS II (CONFIG_MIPS_ISA_2) (NEW)
3. MIPS III (CONFIG_MIPS_ISA_3) (NEW)
4. MIPS IV (CONFIG_MIPS_ISA_4) (NEW)
5. MIPS32 (CONFIG_MIPS_ISA_MIPS32) (NEW)
6. MIPS64 (CONFIG_MIPS_ISA_MIPS64) (NEW)
choice[1-6?]: 5

But it seems these configs were not directly passed to GCC configs according to mips-linux-gcc -v, or GCC config.status.

Quoted 15 lines

Config.in.arch (working copy) line 692

Quoted 13 lines

[3] mips: Current trunk build with a change (for testing)

skuribay at debian:~/devel/buildroot$ svn diff
Index: target/Config.in.arch
===================================================================

Config.in.arch (working copy) renamed from Config.in.arch (revision 20207) +1 -1
@@ -689,7 +689,7 @@
       default iwmmxt          if BR2_iwmmxt
       default 32              if BR2_mipsel && BR2_MIPS_OABI
       default n32             if BR2_mipsel && BR2_MIPS_EABI
-       default o64             if BR2_mips && BR2_MIPS_OABI
+       default 32              if BR2_mips && BR2_MIPS_OABI

I'm pretty sure that this is not really correct either.

Yes, it's just a trial whether --with-abi=32 works for mips or not. I don't know what is appropriate in this case, sorry.

Quoted 8 lines

I will extend these (for mips) to include "ABI32" which boils down to 32.
But think about your change for a second. For mips EB you want to allow for 32bit (1,2,32*) and 64bit where 32bit OABI should use =32 but 64bit OABI should use =o64 as opposed to 64bit ABI32 (=32), 64bit EABI (=eabi), 64bit ABI64 (=64), at least AFAICT.

Does this sound appropriate to you?

Ditto, it's hard for me to answer. I should learn more about GCC config. Anyone MIPS guys?

Anyway thanks for your consideration,

Shinya Kuribayashi

#5 lore raw
Quoted 6 lines · Shinya Kuribayashi
Quoted 1 line · Bernhard Fischer
Quoted 1 line

[1] mips: Before recently toolchain config rework (2007-09-19 build)

<snip>

Quoted 2 lines

I don't know offhand what abi that defaults to. Can you check this, perhaps?

Quoted 6 lines

Yes, confirmed with r19885 (2007-09-18).
At that time, we used to configure ABI and ISA as a uClibc config, right? I always configured O32 ABI and MIPS32, no doubt:

But it seems these configs were not directly passed to GCC configs according to mips-linux-gcc -v, or GCC config.status.

Yes, that's what my recent changes in this area are ment to pin.

Please use 32 manually for now. I'll look at it ASAP.

#6 lore raw
In reply to Shinya Kuribayashi
Quoted 18 lines · Shinya Kuribayashi
Quoted 1 line

1. O32 ABI (CONFIG_MIPS_O32_ABI) (NEW)

2. N32 ABI (CONFIG_MIPS_N32_ABI) (NEW)
3. N64 ABI (CONFIG_MIPS_N64_ABI) (NEW)
choice[1-3?]: 1
Target Processor Architecture

Quoted 1 line

1. Generic (MIPS I) (CONFIG_MIPS_ISA_1) (NEW)

2. MIPS II (CONFIG_MIPS_ISA_2) (NEW)
3. MIPS III (CONFIG_MIPS_ISA_3) (NEW)
4. MIPS IV (CONFIG_MIPS_ISA_4) (NEW)
5. MIPS32 (CONFIG_MIPS_ISA_MIPS32) (NEW)
6. MIPS64 (CONFIG_MIPS_ISA_MIPS64) (NEW)
choice[1-6?]: 5

But it seems these configs were not directly passed to GCC configs according to mips-linux-gcc -v, or GCC config.status.

...

Quoted 2 lines

Ditto, it's hard for me to answer. I should learn more about GCC config. Anyone MIPS guys?

The matrix of MIPS ISA and ABIs supported on Linux is:
(fixed pitch font time)

               o32    n32    n64
MIPS I         o
MIPS II        o
MIPS III       o      o       o
MIPS IV        o      o       o
MIPS32(r1)     o
MIPS32R2       o
MIPS64(r1)     o      o       o
MIPS64R2       o      o       o

(blank is not supported)

MIPS16 is a bare-iron thing, along with other tweaks like using a 64bit FPU inside a 32bit world.
Beth

#7 lore raw
Quoted 13 lines · Elizabeth Oldham

The matrix of MIPS ISA and ABIs supported on Linux is:
(fixed pitch font time)

              o32    n32    n64
MIPS I         o
MIPS II        o
MIPS III       o      o       o
MIPS IV        o      o       o
MIPS32(r1)     o
MIPS32R2       o
MIPS64(r1)     o      o       o
MIPS64R2       o      o       o
Quoted 1 line

(blank is not supported)

And eabi looks much like n32 with a little adjustments here and there. I assume that o64 is supported on any n64 capable target, yes? Are there any endianess constraints or is this freely chooseable on all ISAs?

thanks,

#8 lore raw
Quoted 16 lines · Bernhard Fischer
Quoted 13 lines · Elizabeth Oldham

The matrix of MIPS ISA and ABIs supported on Linux is:
(fixed pitch font time)

             o32    n32    n64
MIPS I         o
MIPS II        o
MIPS III       o      o       o
MIPS IV        o      o       o
MIPS32(r1)     o
MIPS32R2       o
MIPS64(r1)     o      o       o
MIPS64R2       o      o       o
Quoted 5 lines
Quoted 1 line

(blank is not supported)

And eabi looks much like n32 with a little adjustments here and there. I assume that o64 is supported on any n64 capable target, yes? Are there any endianess constraints or is this freely chooseable on all ISAs?

I'm not familar with eabi, I've not heard of it with reference to MIPS. I'd have to ask my more learned colleagues :)
o64 is not supported on Linux, and not going to be AFAIK, but bare-iron it would be as gcc can generate the code.
Once you have a supported ISA/ABI you can choose your endian with impunity.

Beth

#9 lore raw
Quoted 11 lines · Elizabeth Oldham
Quoted 10 lines · Bernhard Fischer
Quoted 10 lines
            o32    n32    n64
MIPS I         o
MIPS II        o
MIPS III       o      o       o
MIPS IV        o      o       o
MIPS32(r1)     o
MIPS32R2       o
MIPS64(r1)     o      o       o
MIPS64R2       o      o       o

(blank is not supported)

Quoted 2 lines

I'm not familar with eabi, I've not heard of it with reference to MIPS. I'd have to ask my more learned colleagues :)

gcc supports it, but AFAIK it isn't used on MIPS/Linux, so I assume buildroot/uclibc wont be interested in it?

Quoted 1 line

Once you have a supported ISA/ABI you can choose your endian with impunity.

Or vice-versa.

I've hacked target/Config.in.arch to what I _think_ it should perhaps look like, and attached it.

Beth

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: Config.in.arch.patch
Url: http://busybox.net/lists/buildroot/attachments/20071009/423c9a47/attachment.diff

#10 lore raw
Quoted 4 lines · Elizabeth Oldham

Elizabeth Oldham wrote:

gcc supports it, but AFAIK it isn't used on MIPS/Linux, so I assume buildroot/uclibc wont be interested in it?

It shouldn't hurt to support it IMHO.

Quoted 2 lines

I've hacked target/Config.in.arch to what I _think_ it should perhaps look like, and attached it.

Look quite similar to what i currently have, yes.

Thanks for your help and kind regards,
-------------- next part --------------
A non-text attachment was scrubbed...
Name: br2.mips-ABIselection.00.diff
Type: text/x-diff
Size: 2210 bytes
Desc: not available
Url : http://busybox.net/lists/buildroot/attachments/20071009/1674700b/attachment.bin

#11 lore raw
Quoted 4 lines · Bernhard Fischer
Quoted 2 lines

I've hacked target/Config.in.arch to what I _think_ it should perhaps look like, and attached it.

Look quite similar to what i currently have, yes.

Gave a try, but failed at GCC configuration.

checking whether getrlimit is declared... yes
checking whether setrlimit is declared... yes
checking whether getrusage is declared... yes
checking whether ldgetname is declared... no
checking whether times is declared... yes
checking whether sigaltstack is declared... yes
checking for struct tms... yes
checking for clock_t... yes
checking for .preinit_array/.init_array/.fini_array support... yes
checking if mkdir takes one argument... no
Unknown ABI used in --with-abi=o32
make[1]: *** [configure-gcc] Error 1
make[1]: Leaving directory `/home/skuribay/devel/buildroot/toolchain_build_mips/gcc-4.2.1-initial'
make: *** [/home/skuribay/devel/buildroot/toolchain_build_mips/gcc-4.2.1-initial/.compiled] Error 2 skuribay at debian:~/devel/buildroot$

thanks,

Shinya Kuribayashi

A message that is not in the archive (sent off-list or not yet received): [email protected]

#13 lore raw
Quoted 5 lines · Elizabeth Oldham
Quoted 3 lines

Elizabeth Oldham wrote:
gcc supports it, but AFAIK it isn't used on MIPS/Linux, so I assume buildroot/uclibc wont be interested in it?

It shouldn't hurt to support it IMHO.

I'd find it confusing having an abi that wasn't supported on the thing I was building for, but whatever.

Quoted 1 line

Look quite similar to what i currently have, yes.

ish. n32 is a 64bit variant, not supported on 32bit cores. The default should be based on the ISA selected, as in my

+	default BR_mips_ABI_O32 if BR_mips_32 || BR_mips_32r2
+	default BR_mips_ABI_N32 if BR_mips_64 || BR_mips_64r2

With whatever naming convention you want to apply of course.

And o32 should end up as just 32 by the time it gets passed to gcc configure.

Beth