ct-ng 1.4.2: problem in creating x86_64 toolchain

View: New views
4 Messages — Rating Filter:   Alert me  

ct-ng 1.4.2: problem in creating x86_64 toolchain

by Zvi Vered :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

I used ct-ng-1.4.2 to build a toolchain for x86-64.
The steps I did:
1. ct-ng x86_64-unknown-linux-gnu
2. Remove java
3. ct-ng build

The toolchain was build OK. When I ran "x86_64-unknown-linux-gnu --v" I got:

Using built-in specs.
Target: x86_64-unknown-linux-gnu
Configured with:
/home/zvivered/GNU/ct-ng-1.4.2/working/src/gcc-4.3.2/configure
--build=i386-build_redhat-linux-gnu --host=i386-build_redhat-linux-gnu
--target=x86_64-unknown-linux-gnu
--prefix=/home/zvivered/GNU/ct-ng-1.4.2/release_64
--with-sysroot=/home/zvivered/GNU/ct-ng-1.4.2/release_64/x86_64-unknown-linux-gnu//sys-root
--enable-languages=c,c++ --disable-multilib
--with-gmp=/home/zvivered/GNU/ct-ng-1.4.2/release_64
--with-mpfr=/home/zvivered/GNU/ct-ng-1.4.2/release_64
--with-pkgversion=crosstool-NG-1.4.2 --enable-__cxa_atexit
--with-local-prefix=/home/zvivered/GNU/ct-ng-1.4.2/release_64/x86_64-unknown-linux-gnu//sys-root
--disable-nls --enable-threads=posix --enable-symvers=gnu --enable-c99
--enable-long-long --enable-target-optspace
Thread model: posix
gcc version 4.3.2 (crosstool-NG-1.4.2)

But when I tried: ldd ld-2.9.so
I got: not a dynamic executable

I also tried ldd myapp.out which is a very simple executable I created
and got the same response.

I built a vanilla kernel with this toolchain. But when this kernel
searches for init, it can't find one. When I replaced the init with
one created with an i686 toolchain it worked fine.

Then I looked at build.log and saw some errors starting from line 25150 :
[ALL  ]    objdump: init-first.o: File format not recognized

What is the reason for those errors ?

By the way, ct-ng is a great tool !!!.
I built a toolchain for i686 and it works great.

Thanks,
Zvika Vered



--
For unsubscribe information see http://sourceware.org/lists.html#faq

.config (9K) Download Attachment
build.log.bz2 (557K) Download Attachment

Re: ct-ng 1.4.2: problem in creating x86_64 toolchain

by Yann E. MORIN :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello Zvi!
Hello All!

On Friday 30 October 2009 05:20:10 Zvi Vered wrote:
> I used ct-ng-1.4.2 to build a toolchain for x86-64.

Please, try updating to 1.5.1.

Regards,
Yann E. MORIN.

--
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
`------------------------------^-------^------------------^--------------------'



--
For unsubscribe information see http://sourceware.org/lists.html#faq


Re: ct-ng 1.4.2: problem in creating x86_64 toolchain

by Yann E. MORIN :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Zvi, all,

On Friday 30 October 2009 05:20:10 Zvi Vered wrote:
> I used ct-ng-1.4.2 to build a toolchain for x86-64.
[--SNIP--]
> The toolchain was build OK. When I ran "x86_64-unknown-linux-gnu --v" I got:
> Using built-in specs.
> Target: x86_64-unknown-linux-gnu
> Configured with:
> /home/zvivered/GNU/ct-ng-1.4.2/working/src/gcc-4.3.2/configure
> --build=i386-build_redhat-linux-gnu --host=i386-build_redhat-linux-gnu
> --target=x86_64-unknown-linux-gnu

So, your host is an x86, not an x86_64, right?

> But when I tried: ldd ld-2.9.so

I suppose you're talking about the ld-2.9.so in the sysroot of the
toolchain, right?

> I got: not a dynamic executable

That's what I would expect: ldd tries to _run_ the executable you pass
as argument. Because your host is x86, and the ld-2.9.so was built for
x86_64, it won't run on the host!

Run "file ld-2.9.so" : what does it tell you?

You should use "x86_64-unknown-linux-gnu-readelf -d" and look at the
'NEEDED' entries.

> I also tried ldd myapp.out which is a very simple executable I created
> and got the same response.

Ditto.

> Then I looked at build.log and saw some errors starting from line 25150 :
> [ALL  ]    objdump: init-first.o: File format not recognized
> What is the reason for those errors ?

glibc tries to use the host objdump (x86) on a target .o (x86_64).
It fails, which is understandable... glibc is wrong, here :-(

> By the way, ct-ng is a great tool !!!.
> I built a toolchain for i686 and it works great.

Thanks!

Regards,
Yann E. MORIN.


--
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
`------------------------------^-------^------------------^--------------------'



--
For unsubscribe information see http://sourceware.org/lists.html#faq


Parent Message unknown Re: ct-ng 1.4.2: problem in creating x86_64 toolchain

by Yann E. MORIN :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Zvi, All,

[Please, keep the mailing list copied]

On Saturday 31 October 2009 20:49:14 Zvi Vered wrote:

> On Sat, Oct 31, 2009 at 12:53 PM, Yann E. MORIN
> <yann.morin.1998@...> wrote:
> > On Friday 30 October 2009 05:20:10 Zvi Vered wrote:
> >> The toolchain was build OK. When I ran "x86_64-unknown-linux-gnu --v" I got:
> >> Using built-in specs.
> >> Target: x86_64-unknown-linux-gnu
> >> Configured with:
> >> /home/zvivered/GNU/ct-ng-1.4.2/working/src/gcc-4.3.2/configure
> >> --build=i386-build_redhat-linux-gnu --host=i386-build_redhat-linux-gnu
> >> --target=x86_64-unknown-linux-gnu
> > So, your host is an x86, not an x86_64, right?
> You are right.

> >> But when I tried: ldd ld-2.9.so
> > I suppose you're talking about the ld-2.9.so in the sysroot of the
> > toolchain, right?
> Right again.

> > Run "file ld-2.9.so" : what does it tell you?
> I got:
> when I ran "file ld-2.9.so" I got:
> ld-2.9.so: ELF 64-bit LSB shared object, AMD x86-64, version 1 (SYSV),
> not stripped

OK, then ld.so is OK

> >
> > You should use "x86_64-unknown-linux-gnu-readelf -d" and look at the
> > 'NEEDED' entries.
> >
> I'm not sure what you mean by 'NEEDED' entries. This is what I got
> after readelf:

You ran readelf against ld.so. But being the dynamic loader, it has no
dependency (or we'd have the chicken-n-egg problem!).

You should run readelf against your program (eg. your mapp.out).

Regards,
Yann E. MORIN.

--
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
`------------------------------^-------^------------------^--------------------'



--
For unsubscribe information see http://sourceware.org/lists.html#faq