On Sat, Sep 08, 2007 at 08:12:27PM +0200, Stefan Reinauer wrote:
> * Uwe Hermann <[EMAIL PROTECTED]> [070908 00:30]:
> > +   $(Q)# On Debian GNU/kFreeBSD we need the linker output format
> > +   $(Q)# 'elf32-i386-freebsd' instead of just 'elf32-i386'.
> > +ifneq (, $(filter Linux GNU GNU_%, $(shell uname -s)))
> 
> I think stuff like this belongs in xcompile!

Good point. Updated patch attached.


Uwe.
-- 
http://www.hermann-uwe.de  | http://www.holsham-traders.de
http://www.crazy-hacks.org | http://www.unmaintained-free-software.org
Add support for building LinuxBIOSv3 on Debian GNU/kFreeBSD systems.

We need the following fixes:

 - Debian GNU/kFreeBSD uses 'elf32-i386-freebsd' (instead of
   'elf32-i386') as linker output format.

 - dtc is missing an '#include <stdint.h>' (needed for uint32_t et al).
   Doesn't seem to be fatal on Linux, but it is on kFreeBSD.

 - kFreeBSD has 'dnsdomainname' (as has Linux) instead of 'domainname'.

Signed-off-by: Uwe Hermann <[EMAIL PROTECTED]>

Index: arch/x86/Makefile
===================================================================
--- arch/x86/Makefile	(revision 496)
+++ arch/x86/Makefile	(working copy)
@@ -143,7 +143,7 @@
 	$(Q)# to properly invoke ld.
 	$(Q)printf "  CC      $(subst $(shell pwd)/,,$(@))\n"
 	$(Q)$(CC) -nostdlib -static -T $(src)/arch/x86/ldscript.ld \
-		$(STAGE0_OBJ) -o $(obj)/stage0.o
+		$(STAGE0_OBJ) -Wl,--oformat,$(LD_OFORMAT) -o $(obj)/stage0.o
 
 	$(Q)printf "  OBJCOPY $(subst $(shell pwd)/,,$(@))\n"
 	$(Q)$(OBJCOPY) -O binary $(obj)/stage0.o $(obj)/stage0.init
Index: util/xcompile/xcompile
===================================================================
--- util/xcompile/xcompile	(revision 496)
+++ util/xcompile/xcompile	(working copy)
@@ -109,6 +109,14 @@
 
 echo "CFLAGS_x86 := $CFLAGS"
 
+# On Debian GNU/kFreeBSD we need the linker output format
+# 'elf32-i386-freebsd' instead of just 'elf32-i386'.
+if [ "$OS" == "GNU/kFreeBSD" ]; then
+	echo "LD_OFORMAT := elf32-i386-freebsd"
+else
+	echo "LD_OFORMAT := elf32-i386"
+fi
+
 # TODO: The same as above for PowerPC, and other architectures
 #       as soon as they are supported by LinuxBIOSv3.
 
Index: util/dtc/endian.h
===================================================================
--- util/dtc/endian.h	(revision 496)
+++ util/dtc/endian.h	(working copy)
@@ -37,6 +37,8 @@
  * See Solaris as an example.
  */
 
+#include <stdint.h>
+
  /* define __BYTE_ORDER to __LITTLE_ENDIAN or __BIG_ENDIAN as appropriate */
 #ifdef linux
 #include <endian.h>
Index: Makefile
===================================================================
--- Makefile	(revision 496)
+++ Makefile	(working copy)
@@ -143,7 +143,7 @@
 	$(Q)printf "#define LINUXBIOS_COMPILE_TIME \"`LANG= date +%T`\"\n" >> $(obj)/build.h
 	$(Q)printf "#define LINUXBIOS_COMPILE_BY \"$(shell PATH=$$PATH:/usr/ucb whoami)\"\n" >> $(obj)/build.h
 	$(Q)printf "#define LINUXBIOS_COMPILE_HOST \"$(shell hostname)\"\n" >> $(obj)/build.h
-	$(Q)printf "#define LINUXBIOS_COMPILE_DOMAIN \"$(shell test `uname -s` = "Linux" && dnsdomainname || domainname)\"\n" >> $(obj)/build.h
+	$(Q)printf "#define LINUXBIOS_COMPILE_DOMAIN \"$(shell test `uname -s` = "Linux" -o `uname -s` = "GNU/kFreeBSD" && dnsdomainname || domainname)\"\n" >> $(obj)/build.h
 
 clean:
 	$(Q)printf "  CLEAN   $(subst $(shell pwd)/,,$(obj))\n"

Attachment: signature.asc
Description: Digital signature

-- 
linuxbios mailing list
[email protected]
http://www.linuxbios.org/mailman/listinfo/linuxbios

Reply via email to