[Buildroot] Host libraries - status

Thomas Petazzoni thomas.petazzoni at free-electrons.com
Wed Jun 23 11:18:00 UTC 2010


On Wed, 23 Jun 2010 11:20:22 +0200
Thomas Petazzoni <thomas.petazzoni at free-electrons.com> wrote:

> Ok, I took the time to investigate this. I tried:
> 
> HOST_LDFLAGS += -Wl,-rpath -Wl,$(HOST_DIR)/usr/lib
> 
> and I could reproduce the fakeroot problem: "preload library not
> found". This happens because libfakeroot.so doesn't get compiled. This
> in turn happens because ./configure detects that LD doesn't support
> shared libraries, which in turn happens because ./configure detects
> that LD isn't GNU LD, which happens because for ld, "-Wl,-rpath
> -Wl,$(HOST_DIR)/usr/lib" are incorrect options. And it's true, since
> the ld option is just "-rpath", the -Wl thing being here to tell gcc
> to pass these options down to ld.

After seeing that PTXdist does exactly this (see
http://git.pengutronix.de/?p=ptxdist.git;a=blob;f=rules/pre/Rules.make;h=1fd3707311a19bc06d9b0d0668e9fb4ae2f6176d;hb=HEAD#l284),
I decided to go deeper into this.

And in fact, the problem comes from :

	LD="$(HOSTLD) $(HOST_LDFLAGS)" \

which I turned into:

	LD="$(HOSTLD)" \

in HOST_CONFIGURE_OPTS.

With this + the HOST_LDFLAGS as shown above, my mkfontscale test case
is OK, and fakeroot continues to work properly. I managed to build a
X.org stack + ext2 filesystem for ARM correctly.

Generally speaking, I think we shouldn't do:

                CC="$(HOSTCC) $(HOST_CFLAGS)" \
                GCC="$(HOSTCC) $(HOST_CFLAGS)" \
                CXX="$(HOSTCXX) $(HOST_CXXFLAGS)" \
                CPP="$(HOSTCPP) $(HOST_CFLAGS)" \

But only set CC="$(HOSTCC)", and pass CFLAGS in a separate variable.

Regards,

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com



More information about the buildroot mailing list