public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Compilation errors building gcc on mipsel
@ 2014-03-12  8:10 Harry Prevor
  2014-03-12 10:54 ` Kai Ruottu
  0 siblings, 1 reply; 10+ messages in thread
From: Harry Prevor @ 2014-03-12  8:10 UTC (permalink / raw)
  To: gcc-help

I'm trying to build gcc-4.8.2 (just the C and C++ compilers) on a mips64el laptop (Lemote Yeeloong) running Debian's mips32el port. 

I made a gcc-build/ directory outside of the source tree and ran "../gcc-4.8.2/configure --prefix=/usr/local --disable-nls --enable-languages=c,c++ mips-unknown-linux-gnu" in it. 

I started the make and it was going well for a few hours, but then I got this error[1] (rather long; see the bottom).

What I think is the relevant portion of the error is reproduced below:

  /usr/bin/ld: emutls_s.o: ABI is incompatible with that of the selected emulation
  /usr/bin/ld: failed to merge target specific data of file emutls_s.o
  /usr/bin/ld: /usr/lib/libc.a(abort.o): compiled for a little endian system and target is big endian
  /usr/bin/ld: /usr/lib/libc.a(abort.o): endianness incompatible with that of the selected emulation
  /usr/bin/ld: failed to merge target specific data of file /usr/lib/libc.a(abort.o)

What can I do to remedy / debug this?

P.S. I am not subscribed to this mailing list, so please CC me on any replies to this message so I can see them.

[1]: http://sprunge.us/QiBH

Thanks,

-- 
Harry Prevor

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Compilation errors building gcc on mipsel
  2014-03-12  8:10 Compilation errors building gcc on mipsel Harry Prevor
@ 2014-03-12 10:54 ` Kai Ruottu
  2014-03-12 14:53   ` Harry Prevor
  0 siblings, 1 reply; 10+ messages in thread
From: Kai Ruottu @ 2014-03-12 10:54 UTC (permalink / raw)
  To: Harry Prevor; +Cc: gcc-help

12.3.2014 1:51, Harry Prevor kirjoitti:
> I'm trying to build gcc-4.8.2 (just the C and C++ compilers) on a mips64el laptop (Lemote Yeeloong) running Debian's mips32el port.
>
> I made a gcc-build/ directory outside of the source tree and ran "../gcc-4.8.2/configure --prefix=/usr/local --disable-nls --enable-languages=c,c++ mips-unknown-linux-gnu" in it.
>
> I started the make and it was going well for a few hours, but then I got this error[1] (rather long; see the bottom).
>
> What I think is the relevant portion of the error is reproduced below:
>
>    /usr/bin/ld: emutls_s.o: ABI is incompatible with that of the selected emulation
>    /usr/bin/ld: failed to merge target specific data of file emutls_s.o
>    /usr/bin/ld: /usr/lib/libc.a(abort.o): compiled for a little endian system and target is big endian
>    /usr/bin/ld: /usr/lib/libc.a(abort.o): endianness incompatible with that of the selected emulation
>    /usr/bin/ld: failed to merge target specific data of file /usr/lib/libc.a(abort.o)
>
> What can I do to remedy / debug this?

The 'mips' type targets are big-endian, 'mipsel' type targets 
little-endian, so when you define the host/target being 
'mips-unknown-linux-gnu'
and don't the configure script to check what the system is, you got just 
what you seemed to want!  So if you had left this away and had
configured with :

    ../gcc-4.8.2/configure --prefix=/usr/local --disable-nls --enable-languages=c,c++

you probably had succeeded...

Ok, you can check what the configury system would tell your system being 
via running :

     ./config.guess

in the main gcc-4.8.2 source directory.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Compilation errors building gcc on mipsel
  2014-03-12 10:54 ` Kai Ruottu
@ 2014-03-12 14:53   ` Harry Prevor
  2014-03-12 21:54     ` Kai Ruottu
  2014-03-13  2:24     ` David Daney
  0 siblings, 2 replies; 10+ messages in thread
From: Harry Prevor @ 2014-03-12 14:53 UTC (permalink / raw)
  To: gcc-help

On Wed, Mar 12, 2014 at 10:11:05AM +0200, Kai Ruottu wrote:
> The 'mips' type targets are big-endian, 'mipsel' type targets
> little-endian, so when you define the host/target being
> 'mips-unknown-linux-gnu'
> and don't the configure script to check what the system is, you got
> just what you seemed to want!  So if you had left this away and had
> configured with :
> 
>    ../gcc-4.8.2/configure --prefix=/usr/local --disable-nls --enable-languages=c,c++
> 
> you probably had succeeded...

Alas, there was unfortunately a previous chapter to my story. 

Before posting this message, I had tried to run "../gcc-4.8.2/configure --prefix=/usr/local --disable-nls --enable-languages=c,c++" instead, but I was just getting a very similar error[1].

I asked in the IRC channel on Freenode, and someone there suggested that I add "mips-unknown-linux-gnu" to the configure line.

He said it may have had to do with my "uname -a" being "broken"; it currently outputs "Linux marielle 3.5.3-gnu #1 PREEMPT Tue Aug 28 10:49:41 UTC 2012 mips64 GNU/Linux". Not sure if there's something wrong with that.

> Ok, you can check what the configury system would tell your system
> being via running :
> 
>     ./config.guess
> 
> in the main gcc-4.8.2 source directory.

Oddly enough, if I run that script, I do get "mips64el-unknown-linux-gnu", so very confused as to what the issue is here.

[1]: http://sprunge.us/DDgM

-- 
Harry Prevor

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Compilation errors building gcc on mipsel
  2014-03-12 14:53   ` Harry Prevor
@ 2014-03-12 21:54     ` Kai Ruottu
  2014-03-13  0:04       ` Harry Prevor
  2014-03-13  2:24     ` David Daney
  1 sibling, 1 reply; 10+ messages in thread
From: Kai Ruottu @ 2014-03-12 21:54 UTC (permalink / raw)
  To: Harry Prevor, gcc-help

12.3.2014 12:54, Harry Prevor kirjoitti:
> Alas, there was unfortunately a previous chapter to my story. Before 
> posting this message, I had tried to run "../gcc-4.8.2/configure 
> --prefix=/usr/local --disable-nls --enable-languages=c,c++" instead, 
> but I was just getting a very similar error[1]. I asked in the IRC 
> channel on Freenode, and someone there suggested that I add 
> "mips-unknown-linux-gnu" to the configure line. He said it may have 
> had to do with my "uname -a" being "broken"; it currently outputs 
> "Linux marielle 3.5.3-gnu #1 PREEMPT Tue Aug 28 10:49:41 UTC 2012 
> mips64 GNU/Linux". Not sure if there's something wrong with that.
>> Ok, you can check what the configury system would tell your system
>> being via running :
>>
>>      ./config.guess
>>
>> in the main gcc-4.8.2 source directory.
> Oddly enough, if I run that script, I do get "mips64el-unknown-linux-gnu", so very confused as to what the issue is here.
>

You can spy how the current GCC was configured via 'gcc -v'.  I could 
guess a 'mipsel-linux-gnu' or
'mipsel-linux-gnueabi' being used in its configure command. Or things to 
define the default output
and CPU to be a 32-bit one instead of the expected 64-bit....

Just for curiosity I checked what the 'gcc-4.3_4.3.5-4_mipsel.deb' 
package from 2012 (like your
system) was and saw it being configured using all the three system names 
being the same :

     --build=mipsel-linux-gnu --host=mipsel-linux-gnu 
--target=mipsel-linux-gnu

(using 'strings gcc-4.3 | less' and searching for 'configure')  You 
should check also the other options
used with the existing native GCC  whether they could be needed...

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Compilation errors building gcc on mipsel
  2014-03-12 21:54     ` Kai Ruottu
@ 2014-03-13  0:04       ` Harry Prevor
  0 siblings, 0 replies; 10+ messages in thread
From: Harry Prevor @ 2014-03-13  0:04 UTC (permalink / raw)
  To: gcc-help

On Wed, Mar 12, 2014 at 04:53:20PM +0200, Kai Ruottu wrote:
> You can spy how the current GCC was configured via 'gcc -v'.  I
> could guess a 'mipsel-linux-gnu' or
> 'mipsel-linux-gnueabi' being used in its configure command. Or
> things to define the default output
> and CPU to be a 32-bit one instead of the expected 64-bit....

Here's the output of my "gcc -v":

Using built-in specs.
Target: mipsel-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 4.4.5-8' --with-bugurl=file:///usr/share/doc/gcc-4.4/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.4 --enable-shared --enable-multiarch --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.4 --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --disable-libssp --enable-targets=all --enable-checking=release --build=mipsel-linux-gnu --host=mipsel-linux-gnu --target=mipsel-linux-gnu
Thread model: posix
gcc version 4.4.5 (Debian 4.4.5-8)

> Just for curiosity I checked what the 'gcc-4.3_4.3.5-4_mipsel.deb'
> package from 2012 (like your
> system) was and saw it being configured using all the three system
> names being the same :
> 
>     --build=mipsel-linux-gnu --host=mipsel-linux-gnu
> --target=mipsel-linux-gnu
> 
> (using 'strings gcc-4.3 | less' and searching for 'configure')  You
> should check also the other options
> used with the existing native GCC  whether they could be needed...

My package version is actually slightly different than that, but your observation is correct. Unfortunately, I don't really know what that means in context. 

Is there something wrong with this configuration? Nothing seems to really jump out at me. If so, what can I do to fix it? 

-- 
Harry Prevor

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Compilation errors building gcc on mipsel
  2014-03-12 14:53   ` Harry Prevor
  2014-03-12 21:54     ` Kai Ruottu
@ 2014-03-13  2:24     ` David Daney
  2014-03-14 20:17       ` Harry Prevor
  2014-03-22  6:22       ` Harry Prevor
  1 sibling, 2 replies; 10+ messages in thread
From: David Daney @ 2014-03-13  2:24 UTC (permalink / raw)
  To: Harry Prevor; +Cc: gcc-help

On 03/12/2014 03:54 AM, Harry Prevor wrote:
> On Wed, Mar 12, 2014 at 10:11:05AM +0200, Kai Ruottu wrote:
>> The 'mips' type targets are big-endian, 'mipsel' type targets
>> little-endian, so when you define the host/target being
>> 'mips-unknown-linux-gnu'
>> and don't the configure script to check what the system is, you got
>> just what you seemed to want!  So if you had left this away and had
>> configured with :
>>
>>     ../gcc-4.8.2/configure --prefix=/usr/local --disable-nls --enable-languages=c,c++
>>
>> you probably had succeeded...
>
> Alas, there was unfortunately a previous chapter to my story.
>
> Before posting this message, I had tried to run "../gcc-4.8.2/configure --prefix=/usr/local --disable-nls --enable-languages=c,c++" instead, but I was just getting a very similar error[1].
>
> I asked in the IRC channel on Freenode, and someone there suggested that I add "mips-unknown-linux-gnu" to the configure line.
>
> He said it may have had to do with my "uname -a" being "broken"; it currently outputs "Linux marielle 3.5.3-gnu #1 PREEMPT Tue Aug 28 10:49:41 UTC 2012 mips64 GNU/Linux". Not sure if there's something wrong with that.
>
>> Ok, you can check what the configury system would tell your system
>> being via running :
>>
>>      ./config.guess
>>
>> in the main gcc-4.8.2 source directory.
>
> Oddly enough, if I run that script, I do get "mips64el-unknown-linux-gnu", so very confused as to what the issue is here.
>

You are running on a 64-bit kernel.

You need to run "linux32":

     # uname -m
     mips64
     # linux32
     # uname -m
     mips

Once you get uname -n reporting a 32-bit environment (i.e. "mips" 
instead of "mips64"), configure should do a better job.

David Daney


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Compilation errors building gcc on mipsel
  2014-03-13  2:24     ` David Daney
@ 2014-03-14 20:17       ` Harry Prevor
  2014-03-22  6:22       ` Harry Prevor
  1 sibling, 0 replies; 10+ messages in thread
From: Harry Prevor @ 2014-03-14 20:17 UTC (permalink / raw)
  To: gcc-help

On Wed, Mar 12, 2014 at 05:04:38PM -0700, David Daney wrote:
> You are running on a 64-bit kernel.
> 
> You need to run "linux32":
> 
>     # uname -m
>     mips64
>     # linux32
>     # uname -m
>     mips
> 
> Once you get uname -n reporting a 32-bit environment (i.e. "mips"
> instead of "mips64"), configure should do a better job.

I think that this is probably the core of the issue, but unfortunately these steps didn't seem to do the trick.

I deleted my build directory entirely and then created a new one. I ran "linux32", then switched to a bash shell. 

Just to make sure, I checked "uname -m" before starting the ./configure (this time it was just "../gcc-4.8.2/configure --prefix=/usr/local --disable-nls --enable-languages=c,c++") and it returned just "mips" (as well as uname -a), so I thought I would be good. But unfortunately, after leaving it "make"ing overnight, the build still errored out with the same "ABI is incompatible with that of the selected emulation" errors. :-(

I even checked the config.guess script after the build failure, and even that returned just "mipsel-unknown-linux-gnu" this time.

Any idea what could be going wrong here?

-- 
Harry Prevor

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Compilation errors building gcc on mipsel
  2014-03-13  2:24     ` David Daney
  2014-03-14 20:17       ` Harry Prevor
@ 2014-03-22  6:22       ` Harry Prevor
  2014-03-23  1:54         ` Kai Ruottu
  1 sibling, 1 reply; 10+ messages in thread
From: Harry Prevor @ 2014-03-22  6:22 UTC (permalink / raw)
  To: gcc-help

Hey David et al --

I don't mean to be an annoyance, but I'm still having the same compilation issues with gcc.

I've discussed this with others and it seems very odd that gcc is erroring out with these ABI issues, despite the fact that my setup is kind of unusual.

What can I do to take this to the next level if a solution isn't immediately apparent? Are there any suggestions to further debug this issue?

Thanks again for all the help so far,

-- 
Harry Prevor

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Compilation errors building gcc on mipsel
  2014-03-22  6:22       ` Harry Prevor
@ 2014-03-23  1:54         ` Kai Ruottu
  2014-03-23 20:00           ` Harry Prevor
  0 siblings, 1 reply; 10+ messages in thread
From: Kai Ruottu @ 2014-03-23  1:54 UTC (permalink / raw)
  To: Harry Prevor, gcc-help

22.3.2014 3:18, Harry Prevor kirjoitti:
> Hey David et al --
>
> I don't mean to be an annoyance, but I'm still having the same compilation issues with gcc.
>
> I've discussed this with others and it seems very odd that gcc is erroring out with these ABI issues, despite the fact that my setup is kind of unusual.

So using :

--build=mipsel-linux-gnu --host=mipsel-linux-gnu --target=mipsel-linux-gnu

in the GCC configure didn't work?   It had worked with your current 
native GCC so...

BTW, what is the format used in the by glibc provided host/target 
library binaries and startups like 'crt1.o' ?
Does it differ from the produced format in 'crtbegin.o', 'crtend.o' etc. 
objects?  There are the GNU binutils like
'readelf' and 'objdump' to tell about the formats...

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Compilation errors building gcc on mipsel
  2014-03-23  1:54         ` Kai Ruottu
@ 2014-03-23 20:00           ` Harry Prevor
  0 siblings, 0 replies; 10+ messages in thread
From: Harry Prevor @ 2014-03-23 20:00 UTC (permalink / raw)
  To: gcc-help

On Sat, Mar 22, 2014 at 08:22:48AM +0200, Kai Ruottu wrote:
> So using :
>
> --build=mipsel-linux-gnu --host=mipsel-linux-gnu --target=mipsel-linux-gnu
>
> in the GCC configure didn't work?   It had worked with your current native
> GCC so...

Indeed, it didn't. I should note that the current gcc I'm using is from
Debian and was likely built with a 32-bit mipsel kernel; I upgraded my
kernel to a 64-bit one and I'd like to build a newer gcc version using it.

> BTW, what is the format used in the by glibc provided host/target library
> binaries and startups like 'crt1.o' ?
> Does it differ from the produced format in 'crtbegin.o', 'crtend.o' etc.
> objects?  There are the GNU binutils like
> 'readelf' and 'objdump' to tell about the formats...

Here is some info on my crt1.o and my build's crtbegin.o and crtend.o, as
provided by objdump -a:

gcc-build/gcc/n32/crtbegin.o: file format elf32-ntradlittlemips
gcc-build/mipsel-linux-gnu/n32/libgcc/crtbegin.o: file format
elf32-ntradlittlemips
gcc-build/gcc/n32/crtend.o: file format elf32-ntradlittlemips
gcc-build/mipsel-linux-gnu/n32/libgcc/crtend.o: file format
elf32-ntradlittlemips
/usr/lib/crt1.o: file format elf32-tradlittlemips

I also did a readelf -a on these files; the output is rather long but can
be seen here:

gcc-build/gcc/n32/crtbegin.o: http://sprunge.us/MjbI
gcc-build/mipsel-linux-gnu/n32/libgcc/crtbegin.o: http://sprunge.us/RNUf
gcc-build/gcc/n32/crtend.o: http://sprunge.us/ATGE
gcc-build/mipsel-linux-gnu/n32/libgcc/crtend.o: http://sprunge.us/AQQY
/usr/lib/crt1.o: http://sprunge.us/TKaE

Thanks again for helping me out; hopefully we can get to the bottom of this.

-- 
Harry Prevor


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2014-03-23  1:54 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-12  8:10 Compilation errors building gcc on mipsel Harry Prevor
2014-03-12 10:54 ` Kai Ruottu
2014-03-12 14:53   ` Harry Prevor
2014-03-12 21:54     ` Kai Ruottu
2014-03-13  0:04       ` Harry Prevor
2014-03-13  2:24     ` David Daney
2014-03-14 20:17       ` Harry Prevor
2014-03-22  6:22       ` Harry Prevor
2014-03-23  1:54         ` Kai Ruottu
2014-03-23 20:00           ` Harry Prevor

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).