Skip to contentSkip to conversation

cross-compiling flags?

DISCUSSION Hollis Blanchard 2 participants 5 messages Nov 4, 2008 – Nov 6, 2008

lore
Share & tools
lore
#0 lore raw

Hi Yu, Christian tells me you have some weird cross-build setup that brings you to want to use gcc's -idirafter flag for zlib headers. I don't like using something that obscure. Can you elaborate on the errors you get when using -I ?

Signature · 2 lines
Hollis Blanchard
IBM Linux Technology Center
#1 lore raw
Quoted 10 lines

-----Original Message-----
From: Hollis Blanchard [mailto:[email protected]]
Sent: Tuesday, November 04, 2008 11:57 PM
To: Liu Yu-B13201
Cc: kvm-ppc
Subject: cross-compiling flags?

Quoted 6 lines

Hi Yu, Christian tells me you have some weird cross-build setup that brings you to want to use gcc's -idirafter flag for zlib headers. I don't like using something that obscure. Can you elaborate on the errors
you get when using -I ?

Hi Hollis,

Sorry, I attended FTF yesterday.

I don't know what libc headers are used in your case. The host libc header files?
In my case, the libc headers are already appointed to a toolchain-combined version in LTIB(assume you know it).
But zlib.h is not existing so I had to use qemu-cflag to appoint another dir

The problem I met is that my zlib.h is mixed with a lot of other libc header files.
After I '-I' this dir, the build adopted libc header files in this dir, then I met a lot of errors such as "redifination of int8_t".

I think it's because that the dir appointed by '-I' will be considerred prior,
but the dir appointed by '-idirafter' will be considerred at last. That's why I can pass the building by using '-idirafter'.

I think now that the qemu-cflags is additional options based on the configuration default options,
the options in qemu-cflags should not influence the default opions in configuration.

What do you think of it? Is this approach the best way?

#2 lore raw
In reply to Hollis Blanchard
Quoted 15 lines · On Wednesday 05 November 2008 20:51:18 Liu Yu wrote:
Quoted 8 lines

-----Original Message-----
From: Hollis Blanchard [mailto:[email protected]]
Sent: Tuesday, November 04, 2008 11:57 PM
To: Liu Yu-B13201
Cc: kvm-ppc
Subject: cross-compiling flags?

Quoted 6 lines

Hi Yu, Christian tells me you have some weird cross-build setup that brings you to want to use gcc's -idirafter flag for zlib headers. I don't like using something that obscure. Can you elaborate on the errors
you get when using -I ?

Quoted 2 lines

I don't know what libc headers are used in your case. The host libc header files?

When I cross-compile qemu, it's using the cross-toolchain glibc headers. Since my toolchain is from crosstool, those headers are
at /opt/crosstool/gcc-3.4.5-glibc-2.3.6/powerpc-440-linux-gnu/powerpc-440-linux-gnu

Quoted 4 lines

In my case, the libc headers are already appointed to a toolchain-combined version in LTIB(assume you know it).
But zlib.h is not existing so I had to use qemu-cflag to appoint another dir

If your zlib headers are mixed in with the target libc headers, then why do you need any -I at all?

I have heard of LTIB, but I don't know how its toolchain is installed.

Signature · 2 lines
Hollis Blanchard
IBM Linux Technology Center
#3 lore raw
In reply to Hollis Blanchard
Quoted 30 lines

-----Original Message-----
From: Hollis Blanchard [mailto:[email protected]]
Sent: Thursday, November 06, 2008 12:40 PM
To: Liu Yu-B13201
Cc: kvm-ppc
Subject: Re: cross-compiling flags?

Quoted 9 lines · On Wednesday 05 November 2008 20:51:18 Liu Yu wrote:
Quoted 9 lines

-----Original Message-----
From: Hollis Blanchard [mailto:[email protected]]
Sent: Tuesday, November 04, 2008 11:57 PM
To: Liu Yu-B13201
Cc: kvm-ppc
Subject: cross-compiling flags?

Hi Yu, Christian tells me you have some weird cross-build

setup that

Quoted 1 line
Quoted 1 line

brings you to want to use gcc's -idirafter flag for zlib

headers. I

Quoted 7 lines
Quoted 4 lines

don't like using something that obscure. Can you elaborate on the errors
you get when using -I ?

I don't know what libc headers are used in your case. The host libc header files?

Quoted 6 lines

When I cross-compile qemu, it's using the cross-toolchain glibc headers. Since
my toolchain is from crosstool, those headers are
at /opt/crosstool/gcc-3.4.5-glibc-2.3.6/powerpc-440-linux-gnu/pow erpc-440-linux-gnu

Yes, me too.

Quoted 10 lines
Quoted 4 lines

In my case, the libc headers are already appointed to a toolchain-combined version in LTIB(assume you know it). But zlib.h is not existing so I had to use qemu-cflag to

appoint another

Quoted 1 line

dir

If your zlib headers are mixed in with the target libc headers, then why do
you need any -I at all?

The zlib headers are mixed in powerpc local libc headers not the toolchain cross libc headers. And it seems the local libc headers is unfit for cross building.

#4 lore raw
In reply to Hollis Blanchard
Quoted 15 lines · Liu Yu
Quoted 7 lines

When I cross-compile qemu, it's using the cross-toolchain glibc headers. Since
my toolchain is from crosstool, those headers are
at /opt/crosstool/gcc-3.4.5-glibc-2.3.6/powerpc-440-linux-gnu/pow erpc-440-linux-gnu

Yes, me too.

Quoted 5 lines
Quoted 4 lines

In my case, the libc headers are already appointed to a toolchain-combined version in LTIB(assume you know it). But zlib.h is not existing so I had to use qemu-cflag to

appoint another

Quoted 8 lines
Quoted 5 lines
Quoted 1 line

dir

If your zlib headers are mixed in with the target libc headers, then why do
you need any -I at all?

The zlib headers are mixed in powerpc local libc headers not the toolchain cross libc headers. And it seems the local libc headers is unfit for cross building.

Since I'm not familiar with LTIB, I chatted with Kumar Gala about this briefly, and he suggested that you post your issue to the internal Freescale LTIB list.

My understanding is that you have a special directory for target headers, which is used by the cross toolchain. Without understanding the details, my suggestion would be to build a second copy of zlib from source, and configure it with --prefix=/target/specific/directory.

Signature · 2 lines
Hollis Blanchard
IBM Linux Technology Center