I did and I came up with a better solution. I added an option called BUILDID_OPTION to the process. This is a string that is set to the "-Wl,--build-id=none" for newer ld versions and can be set to blank for older ld versions. I have attached the patch file to add this to V2. I think this should take care of any backwards compatibility. :-)

/*********************
Marc Karasek
MTS
Sun Microsystems
mailto:[EMAIL PROTECTED]
ph:770.360.6415
*********************/



ron minnich wrote:
I think you are adding too much complexity to the build process. it
may be time to step back a bit and  think about all this.

Just my $.02

ron
Index: src/config/Config.lb
===================================================================
--- src/config/Config.lb	(revision 3003)
+++ src/config/Config.lb	(working copy)
@@ -38,14 +38,15 @@
         action  "ar cr linuxbios.a $(OBJECTS)"
 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) $(BUILDID_OPTION) -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) $(BUILDID_OPTION) -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
 
@@ -121,7 +122,7 @@
 
 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) $(BUILDID_OPTION) -nostdlib -nostartfiles -static -o $@ -T ldscript.ld crt0.o $(INIT-OBJECTS)"
 	action	"$(CROSS_COMPILE)nm -n linuxbios | sort > linuxbios.map"
 end
 
Index: src/config/Options.lb
===================================================================
--- src/config/Options.lb	(revision 3003)
+++ src/config/Options.lb	(working copy)
@@ -819,6 +819,12 @@
 # Misc options
 ###############################################
 
+define BUILDID_OPTION
+	default "-Wl,--build-id=none"
+	export always
+	comment "Sets option for adding build-id to ld options, change this to be blank for older ld versions"
+end 
+
 define CONFIG_CHIP_NAME
 	default 0
 	export always
Index: src/config/linuxbios_ram.ld
===================================================================
--- src/config/linuxbios_ram.ld	(revision 3003)
+++ src/config/linuxbios_ram.ld	(working copy)
@@ -63,6 +63,13 @@
 
 		_erodata = .;
 	}	
+	
+	/* ld segfaults if we give it --build-id and then discard this section */
+/*	
+	.note.gnu.build-id : {
+		*(.note.gnu.build-id)
+	}
+*/
 	/*
 	 * After the code we place initialized data (typically initialized
 	 * global variables). This gets copied into ram by startup code.
Index: src/arch/i386/Config.lb
===================================================================
--- src/arch/i386/Config.lb	(revision 3003)
+++ src/arch/i386/Config.lb	(working copy)
@@ -100,7 +100,7 @@
 
         makerule linuxbios   
 		depends	"crt0.o init.o $(LINUXBIOS_APC) $(LINUXBIOS_RAM_ROM) ldscript.ld"
-		action	"$(CC) -nostdlib -nostartfiles -static -o $@ -T ldscript.ld crt0.o init.o"
+		action	"$(CC) $(BUILDID_OPTION) -nostdlib -nostartfiles -static -o $@ -T ldscript.ld crt0.o init.o"
 		action	"$(CROSS_COMPILE)nm -n linuxbios | sort > linuxbios.map"
         end
 
Index: src/arch/i386/lib/id.lds
===================================================================
--- src/arch/i386/lib/id.lds	(revision 3003)
+++ src/arch/i386/lib/id.lds	(working copy)
@@ -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)
 	}
-- 
linuxbios mailing list
linuxbios@linuxbios.org
http://www.linuxbios.org/mailman/listinfo/linuxbios

Reply via email to