On 1/7/08, Myles Watson <[EMAIL PROTECTED]> wrote:
> Sorry to be picky, but it seems like this breaks if they mention
> build-id more than once in the help in the future.  I think >0 would
> be better than ==1.

Using grep instead of awk would address this issue, and is a bit
simpler (see attached).

Also, is it appropriate to commit the change to
src/arch/i386/lib/id.lds as a "temporary fix" with a magic value for
_ROMTEMP if no one really understands why the commented-out code
doesn't work?

--Ed
Index: LinuxBIOSv2-3023/src/arch/i386/lib/id.lds
===================================================================
--- LinuxBIOSv2-3023.orig/src/arch/i386/lib/id.lds
+++ LinuxBIOSv2-3023/src/arch/i386/lib/id.lds
@@ -1,5 +1,11 @@
 SECTIONS {
-       . = (_ROMBASE + ROM_IMAGE_SIZE - 0x10) - (__id_end - __id_start);
+
+/*
+ *           . = (_ROMBASE + (ROM_IMAGE_SIZE - 0x10)) - (__id_end - 
__id_start);
+ *             This is a temporary fix.  Under Fedora 8 ld does not like it if 
the .id section is above address 0xFFFF_EF00          
+*/
+        _ROMTEMP = 0xffffef00;
+        . = _ROMTEMP;
        .id (.): {
                *(.id)
        }
Index: LinuxBIOSv2-3023/src/config/Config.lb
===================================================================
--- LinuxBIOSv2-3023.orig/src/config/Config.lb
+++ LinuxBIOSv2-3023/src/config/Config.lb
@@ -8,7 +8,7 @@ makedefine LIBGCC_FILE_NAME := $(shell $
 makedefine GCC_INC_DIR := $(shell $(CC) -print-search-dirs | sed -ne 
"s/install: \(.*\)/\1include/gp")
 
 makedefine CPPFLAGS := -I$(TOP)/src/include -I$(TOP)/src/arch/$(ARCH)/include 
-I$(GCC_INC_DIR) $(CPUFLAGS)
-makedefine CFLAGS := $(CPU_OPT) $(CPPFLAGS) -Os -nostdinc -nostdlib 
-fno-builtin  -Wall
+makedefine CFLAGS := $(CPU_OPT) $(DISTRO_CFLAGS) $(CPPFLAGS) -Os -nostdinc 
-nostdlib -fno-builtin  -Wall
 
 makedefine HOSTCFLAGS:= -Os -Wall
 
@@ -40,12 +40,12 @@ end
 
 makerule linuxbios_ram.o
        depends "$(DRIVER) linuxbios.a $(LIBGCC_FILE_NAME)" 
-       action  "$(CC) -nostdlib -r -o $@ c_start.o $(DRIVER) linuxbios.a 
$(LIBGCC_FILE_NAME)"
+       action  "$(CC) $(DISTRO_LFLAGS) -nostdlib -r -o $@ c_start.o $(DRIVER) 
linuxbios.a $(LIBGCC_FILE_NAME)"
 end
 
 makerule linuxbios_ram
        depends "linuxbios_ram.o $(TOP)/src/config/linuxbios_ram.ld ldoptions" 
-       action  "$(CC) -nostdlib -nostartfiles -static -o $@ -T 
$(TOP)/src/config/linuxbios_ram.ld linuxbios_ram.o"
+       action  "$(CC) $(DISTRO_LFLAGS) -nostdlib -nostartfiles -static -o $@ 
-T $(TOP)/src/config/linuxbios_ram.ld linuxbios_ram.o"
        action  "$(CROSS_COMPILE)nm -n linuxbios_ram | sort > linuxbios_ram.map"
 end
 
@@ -83,12 +83,12 @@ if CONFIG_AP_CODE_IN_CAR
 
        makerule linuxbios_apc.o
                depends "linuxbios_apc.a c_start.o $(LIBGCC_FILE_NAME)"
-        action  "$(CC) -nostdlib -r -o $@ c_start.o linuxbios_apc.a 
$(LIBGCC_FILE_NAME)"
+        action  "$(CC) $(DISTRO_LFLAGS) -nostdlib -r -o $@ c_start.o 
linuxbios_apc.a $(LIBGCC_FILE_NAME)"
        end
 
        makerule linuxbios_apc
                depends "linuxbios_apc.o $(TOP)/src/config/linuxbios_apc.ld 
ldoptions"
-               action  "$(CC) -nostdlib -nostartfiles -static -o $@ -T 
$(TOP)/src/config/linuxbios_apc.ld linuxbios_apc.o"
+               action  "$(CC) $(DISTRO_LFLAGS) -nostdlib -nostartfiles -static 
-o $@ -T $(TOP)/src/config/linuxbios_apc.ld linuxbios_apc.o"
                action  "$(CROSS_COMPILE)nm -n linuxbios_apc | sort > 
linuxbios_apc.map"
        end
 
@@ -121,7 +121,7 @@ makedefine LINUXBIOS_RAM_ROM:=linuxbios_
 
 makerule linuxbios   
        depends "crt0.o $(INIT-OBJECTS) $(LINUXBIOS_APC) $(LINUXBIOS_RAM_ROM) 
ldscript.ld"
-       action  "$(CC) -nostdlib -nostartfiles -static -o $@ -T ldscript.ld 
crt0.o $(INIT-OBJECTS)"
+       action  "$(CC) $(DISTRO_LFLAGS) -nostdlib -nostartfiles -static -o $@ 
-T ldscript.ld crt0.o $(INIT-OBJECTS)"
        action  "$(CROSS_COMPILE)nm -n linuxbios | sort > linuxbios.map"
 end
 
Index: LinuxBIOSv2-3023/targets/buildtarget
===================================================================
--- LinuxBIOSv2-3023.orig/targets/buildtarget
+++ LinuxBIOSv2-3023/targets/buildtarget
@@ -53,4 +53,30 @@ fi
 export PYTHONPATH=$config_dir
 $PYTHON $config_py $config_lb $lbpath
 
+# now start checking for distro-specific breakage. 
+## This check is for the no stack protector mess.
+EXTRA_CFLAGS=
+
+if [ -z "$CC" ]; then
+       CC=gcc
+fi
+
+$CC -fno-stack-protector -S -xc /dev/null -o .$$.tmp
+
+if [ $? -eq 0 ]; then
+       EXTRA_CFLAGS=-fno-stack-protector
+fi
+
+rm -rf .$$.tmp
+
+if ld --help | grep -q build-id; then
+       EXTRA_LFLAGS+=" -Wl,--build-id=none"
+fi
+
+for i in $build_dir/Makefile.settings $build_dir/*/Makefile.settings
+do
+       echo DISTRO_CFLAGS+=$EXTRA_CFLAGS >>$i
+       echo DISTRO_LFLAGS+=$EXTRA_LFLAGS >>$i
+done
+
 exit $?
-- 
linuxbios mailing list
linuxbios@linuxbios.org
http://www.linuxbios.org/mailman/listinfo/linuxbios

Reply via email to