[haiku-development] [RFC] arm usb bus_manager -fno-pic

  • From: kallisti5 <kallisti5@xxxxxxxxxxx>
  • To: <haiku-development@xxxxxxxxxxxxx>
  • Date: Sat, 15 Sep 2012 21:21:27 -0500

I made a few small tweaks to get the overo arm image building again based on the build-bot errors:


jam -j4 -q -sHAIKU_BOOT_BOARD=overo haiku-mmc-image

InitScript1 /Buildbot/slave/arm-any-host/generated.arm_overo/haiku-floppyboot-copy-files KernelLd /Buildbot/slave/arm-any-host/generated.arm_overo/objects/haiku/arm/release/system/kernel/kernel.so /Buildbot/slave/cross-tools-arm/cross-tools/bin/arm-unknown-haiku-ld: /Buildbot/slave/arm-any-host/generated.arm_overo/objects/haiku/arm/release/system/kernel/cache/kernel_cache.o: relocation R_ARM_MOVW_ABS_NC against `a local symbol' can not be used when making a shared object; recompile with -fPIC /Buildbot/slave/arm-any-host/generated.arm_overo/objects/haiku/arm/release/system/kernel/cache/kernel_cache.o: could not read symbols: Bad value

and

Link generated/objects/haiku/arm/release/add-ons/kernel/bus_managers/usb/usb SetType1 generated/objects/haiku/arm/release/add-ons/kernel/busses/ata/silicon_image_3112/silicon_image_3112 /home/kallisti5/Projects/haiku/generated/cross-tools/lib/gcc/arm-unknown-haiku/4.6.2/../../../../arm-unknown-haiku/bin/ld: generated/objects/haiku/arm/release/add-ons/kernel/bus_managers/usb/libusb.a(Stack.o): relocation R_ARM_MOVW_ABS_NC against `a local symbol' can not be used when making a shared object; recompile with -fPIC generated/objects/haiku/arm/release/add-ons/kernel/bus_managers/usb/libusb.a: could not read symbols: Bad value
collect2: ld returned 1 exit status

changes:
==========================[SNIP]=========================
diff --git a/build/jam/BuildSetup b/build/jam/BuildSetup
index ce2ed40..67ea9a7 100644
--- a/build/jam/BuildSetup
+++ b/build/jam/BuildSetup
@@ -347,6 +347,11 @@ HAIKU_KERNEL_PIC_CCFLAGS = -fno-pic ;
 HAIKU_KERNEL_PIC_LINKFLAGS = ;

 switch $(HAIKU_ARCH) {
+       case arm :
+       {
+               HAIKU_KERNEL_PIC_CCFLAGS = ;
+               HAIKU_KERNEL_PIC_LINKFLAGS = ;
+       }
        case ppc :
        {
# Build a position independent PPC kernel. We need to be able to
@@ -355,7 +360,6 @@ switch $(HAIKU_ARCH) {
                HAIKU_KERNEL_PIC_CCFLAGS = -fPIE ;
                HAIKU_KERNEL_PIC_LINKFLAGS = -shared -fPIE ;
        }
-
        case m68k :
        {
# We don't want to have to handle emulating missing FPU opcodes for 040 diff --git a/src/add-ons/kernel/bus_managers/usb/Jamfile b/src/add-ons/kernel/bus_managers/usb/Jamfile
index 737c74e..5c8afe8 100644
--- a/src/add-ons/kernel/bus_managers/usb/Jamfile
+++ b/src/add-ons/kernel/bus_managers/usb/Jamfile
@@ -28,8 +28,7 @@ KernelStaticLibrary libusb.a :
        Object.cpp
        PhysicalMemoryAllocator.cpp
        $(compatSources)
-       : -fno-pic
-;
+;

 KernelAddon usb :
        usb.cpp
==========================[SNIP]=========================

The changes above get the arm overo mmc image compiling.

Does anyone know if there was a reason for the usb bus_manager always getting -fno-pic? I'm not seeing any of the other KernelStaticLibrary targets using -fno-pic and want make sure there wasn't any special reason.

The -fno-pic was added here:
http://cgit.haiku-os.org/haiku/commit/src/add-ons/kernel/bus_managers/usb/Jamfile?id=338b8dc301721b1f472e8297a898d4eaa2f2ee3a

-- Alex


Other related posts: