Skip to contentSkip to conversation

-fpic?

Mini-OS Samuel Thibault 3 participants 5 messages Nov 27, 2007 – Nov 28, 2007

lore
Share & tools
lore
#0 lore raw

Is there a reason for using -fpic when compiling mini-os?

I'm asking because that actually causes linking troubles in my stubdomain work, and just dropping it works fine (and I don't see why we'd need it)

Samuel

#1 lore raw

If it builds without it then it should be fine, I believe.

-- Keir

Quoted 12 lines · Samuel Thibault

Is there a reason for using -fpic when compiling mini-os?

I'm asking because that actually causes linking troubles in my stubdomain work, and just dropping it works fine (and I don't see why we'd need it)

Samuel

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#2 lore raw

Re: [Mini-OS] Drop useless -fpic flag

Quoted 1 line · Keir Fraser, le Tue 27 Nov 2007 12:33:23 +0000, a écrit :

If it builds without it then it should be fine, I believe.

And nobody raised his hand, so here is a patch:

Drop useless -fpic flag.

extras/mini-os/arch/x86/arch.mk +1 -1
diff -r c555a5f97982 extras/mini-os/arch/x86/arch.mk
@@ -17,7 +17,7 @@ endif
 endif
 
 ifeq ($(TARGET_ARCH),x86_64)
-ARCH_CFLAGS := -m64 -mno-red-zone -fpic -fno-reorder-blocks
+ARCH_CFLAGS := -m64 -mno-red-zone -fno-reorder-blocks
 ARCH_CFLAGS += -fno-asynchronous-unwind-tables
 ARCH_ASFLAGS := -m64
 ARCH_LDFLAGS := -m elf_x86_64
#3 lore raw

Re: [Mini-OS] Drop useless -fpic flag

Ah yes, I think the -fpic was inherited from Xen's Makefile. Xen has to be built -fpic because it is not linked sufficiently close to address 0x0 to use absolute addressing the 32-bit displacements. This isn't the case for minios.

-- Keir

Quoted 21 lines · Samuel Thibault
Quoted 1 line · Keir Fraser, le Tue 27 Nov 2007 12:33:23 +0000, a écrit :

If it builds without it then it should be fine, I believe.

And nobody raised his hand, so here is a patch:

Drop useless -fpic flag.

diff -r c555a5f97982 extras/mini-os/arch/x86/arch.mk

extras/mini-os/arch/x86/arch.mk Wed Nov 28 16:33:37 2007 +0000 renamed from extras/mini-os/arch/x86/arch.mk Wed Nov 28 13:36:56 2007 +0000 +1 -1
@@ -17,7 +17,7 @@ endif
 endif
 
 ifeq ($(TARGET_ARCH),x86_64)
-ARCH_CFLAGS := -m64 -mno-red-zone -fpic -fno-reorder-blocks
+ARCH_CFLAGS := -m64 -mno-red-zone -fno-reorder-blocks
 ARCH_CFLAGS += -fno-asynchronous-unwind-tables
 ARCH_ASFLAGS := -m64
 ARCH_LDFLAGS := -m elf_x86_64
#4 lore raw

Re: [Mini-OS] Drop useless -fpic flag

Yes, that's right. At the time I was writing the first version I just copied all the flags. I, too, believe -fpic acn be discarded.

Cheers
Gregor

Quoted 37 lines · Keir Fraser

Ah yes, I think the -fpic was inherited from Xen's Makefile. Xen has to be built -fpic because it is not linked sufficiently close to address 0x0 to use absolute addressing the 32-bit displacements. This isn't the case for minios.

-- Keir

Quoted 18 lines · Samuel Thibault
Quoted 1 line · Keir Fraser, le Tue 27 Nov 2007 12:33:23 +0000, a écrit :

If it builds without it then it should be fine, I believe.

And nobody raised his hand, so here is a patch:

Drop useless -fpic flag.

diff -r c555a5f97982 extras/mini-os/arch/x86/arch.mk

extras/mini-os/arch/x86/arch.mk Wed Nov 28 16:33:37 2007 +0000 renamed from extras/mini-os/arch/x86/arch.mk Wed Nov 28 13:36:56 2007 +0000 +0 -0
@@ -17,7 +17,7 @@ endif

endif

ifeq ($(TARGET_ARCH),x86_64)

extras/mini-os/arch/x86/arch.mk Wed Nov 28 16:33:37 2007 +0000 renamed from extras/mini-os/arch/x86/arch.mk Wed Nov 28 13:36:56 2007 +0000 +1 -1
-ARCH_CFLAGS := -m64 -mno-red-zone -fpic -fno-reorder-blocks
+ARCH_CFLAGS := -m64 -mno-red-zone -fno-reorder-blocks
Quoted 3 lines

ARCH_CFLAGS += -fno-asynchronous-unwind-tables
ARCH_ASFLAGS := -m64
ARCH_LDFLAGS := -m elf_x86_64

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel