qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v5 3/3] configure/Make: Build libfdt from submod


From: Peter Crosthwaite
Subject: Re: [Qemu-devel] [PATCH v5 3/3] configure/Make: Build libfdt from submodule DTC
Date: Mon, 22 Apr 2013 14:45:02 +1000

Hi Paolo, Blue,

On Sun, Apr 21, 2013 at 11:16 PM, Paolo Bonzini <address@hidden> wrote:
> Il 20/04/2013 20:42, Blue Swirl ha scritto:
>> This is not entirely correct, I get these errors:
>> mingw32:
>>      CC libfdt/fdt.o
>> cc1: warnings being treated as errors
>> /src/qemu/dtc/libfdt/fdt.c:1: warning: -fPIC ignored for target (all
>> code is position independent)
>>

This is coming from the dtc makefile which explicitly passes in -fPIC
via its default CFLAGS. I tried fixing by setting the Make invocation
to replace CFLAGS entirely, which in effect removes the -fPIC: But I
suffer a similar (later) failure to the one you posted below:

  LINK  arm-softmmu/qemu-system-arm
/usr/bin/ld: 
/home/peterc/Petalogix/Internal/plgx_src/qemu-build/dtc/libfdt/libfdt.a(fdt.o):
relocation R_X86_64_32S against `.rodata' can not be used when making
a shared object; recompile with -fPIC
/home/peterc/Petalogix/Internal/plgx_src/qemu-build/dtc/libfdt/libfdt.a:
could not read symbols: Bad value

Looks like QEMU mandates that all static objects are -fPIC. A bit of
googling suggests that this error is mingw specific in that mingw
can't handle -fPIC.

>> Other flags, including -fPIC, is missing for Clang:
>>      LD libfdt/libfdt-1.3.0.so
>> /usr/bin/ld: libfdt/fdt.o: relocation R_X86_64_32S against `.rodata'
>> can not be used when making a shared object; recompile with -fPIC
>>

Is this the only clang failure? If so, I'd like to favour Paolos
suggestion of just not building the .so and then we can ignore this
altogether.

>> My build script also passes additional CFLAGS to both.
>>
>> Perhaps the fix is to use QEMU_CFLAGS instead of (or in addition to)
>> CFLAGS above for DTC_CFLAGS?

CFLAGS + QEMU_CFLAGS works as of today, although I was hesitant to do
this at first as it exposes us to issues if QEMU specific CFLAGS are
added in the future than cause DTC build breakage. But ive put the fix
on list to pass in QEMU_CFLAGS as it should unbreak your build.

>> Or add -fPIC as with pixman?

Wont that just expose us to the same mingw werror failure above?

>
> libfdt is not that portable, it doesn't use libtool to build shared
> libraries.
>
> Perhaps we can just build the static library?
>

Seems reasonable, and got this working with fairly low effort. Fix on list.

Regards,
Peter

> Paolo
>
>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]