changeset 24324:b05a6e6f622a

12016 Use of GNU ld should explicitly specify the required output format Reviewed by: Toomas Soome <tsoome@me.com> Reviewed by: Matthias Scheler <matthias.scheler@wdc.com> Approved by: Robert Mustacchi <rm@fingolfin.org>
author Andy Fiddaman <omnios@citrus-it.co.uk>
date Sun, 24 Nov 2019 23:09:59 +0000
parents 887609c1e46b
children ad041189cf56
files usr/src/boot/sys/boot/Makefile.inc usr/src/boot/sys/boot/i386/btx/btx/Makefile usr/src/boot/sys/boot/i386/btx/btxldr/Makefile usr/src/boot/sys/boot/i386/btx/lib/Makefile usr/src/boot/sys/boot/i386/cdboot/Makefile usr/src/boot/sys/boot/i386/pmbr/Makefile usr/src/grub/grub-0.97/Makefile.solaris.defs usr/src/grub/grub-0.97/stage1/Makefile.solaris usr/src/grub/grub-0.97/stage2/Makefile.solaris
diffstat 9 files changed, 29 insertions(+), 19 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/boot/sys/boot/Makefile.inc	Mon Nov 18 16:42:05 2019 +0200
+++ b/usr/src/boot/sys/boot/Makefile.inc	Sun Nov 24 23:09:59 2019 +0000
@@ -12,6 +12,7 @@
 #
 # Copyright 2017 Toomas Soome <tsoome@me.com>
 # Copyright 2019 Joyent, Inc.
+# Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
 #
 
 # loader.help build needs better awk
@@ -21,6 +22,9 @@
 OBJDUMP=	$(GNU_ROOT)/bin/gobjdump
 GSTRIP=		$(GNU_ROOT)/bin/gstrip
 
+GLDTARGET=	-melf_i386_sol2
+LDFLAGS	+=	$(GLDTARGET)
+
 # Default Console font setup.
 # We want it to be the same as kernel.
 # We build compressed, stripped down version of the default font, so we have
--- a/usr/src/boot/sys/boot/i386/btx/btx/Makefile	Mon Nov 18 16:42:05 2019 +0200
+++ b/usr/src/boot/sys/boot/i386/btx/btx/Makefile	Sun Nov 24 23:09:59 2019 +0000
@@ -11,6 +11,7 @@
 
 #
 # Copyright 2015 Toomas Soome <tsoome@me.com>
+# Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
 #
 
 include $(SRC)/Makefile.master
@@ -41,7 +42,7 @@
 
 ORG=	0x9000
 
-LDFLAGS=-e start -Ttext ${ORG} -N -S --oformat binary
+LDFLAGS=-e start -Ttext ${ORG} -N -S --oformat binary $(GLDTARGET)
 
 all install:	$(PROG)
 
--- a/usr/src/boot/sys/boot/i386/btx/btxldr/Makefile	Mon Nov 18 16:42:05 2019 +0200
+++ b/usr/src/boot/sys/boot/i386/btx/btxldr/Makefile	Sun Nov 24 23:09:59 2019 +0000
@@ -11,6 +11,7 @@
 
 #
 # Copyright 2015 Toomas Soome <tsoome@me.com>
+# Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
 #
 
 include $(SRC)/Makefile.master
@@ -25,7 +26,7 @@
 CPPFLAGS += -DBTXLDR_VERBOSE
 CPPFLAGS += -I./../../common
 
-LDFLAGS=-e start -Ttext ${LOADER_ADDRESS} -N -S --oformat binary
+LDFLAGS=-e start -Ttext ${LOADER_ADDRESS} -N -S --oformat binary $(GLDTARGET)
 
 all install:	$(PROG)
 
--- a/usr/src/boot/sys/boot/i386/btx/lib/Makefile	Mon Nov 18 16:42:05 2019 +0200
+++ b/usr/src/boot/sys/boot/i386/btx/lib/Makefile	Sun Nov 24 23:09:59 2019 +0000
@@ -11,6 +11,7 @@
 
 #
 # Copyright 2015 Toomas Soome <tsoome@me.com>
+# Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
 #
 
 include $(SRC)/Makefile.master
@@ -23,7 +24,7 @@
 SRCS=	btxcsu.S btxsys.s btxv86.s
 OBJS=	btxcsu.o btxsys.o btxv86.o
 
-LDFLAGS =-r
+LDFLAGS = -r $(GLDTARGET)
 
 all install: $(PROG)
 
--- a/usr/src/boot/sys/boot/i386/cdboot/Makefile	Mon Nov 18 16:42:05 2019 +0200
+++ b/usr/src/boot/sys/boot/i386/cdboot/Makefile	Sun Nov 24 23:09:59 2019 +0000
@@ -11,6 +11,7 @@
 
 #
 # Copyright 2015 Toomas Soome <tsoome@me.com>
+# Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
 #
 
 include $(SRC)/Makefile.master
@@ -24,10 +25,9 @@
 SRCS=	${PROG}.S
 OBJS=	$(SRCS:%.S=%.o)
 
-
 ORG=	0x7c00
 
-LDFLAGS=-e start -Ttext $(ORG) -N -S --oformat binary
+LDFLAGS=-e start -Ttext $(ORG) -N -S --oformat binary $(GLDTARGET)
 
 all:	${PROG}
 
--- a/usr/src/boot/sys/boot/i386/pmbr/Makefile	Mon Nov 18 16:42:05 2019 +0200
+++ b/usr/src/boot/sys/boot/i386/pmbr/Makefile	Sun Nov 24 23:09:59 2019 +0000
@@ -11,6 +11,7 @@
 
 #
 # Copyright 2015 Toomas Soome <tsoome@me.com>
+# Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
 #
 
 #
@@ -28,7 +29,7 @@
 
 ORG=	0x600
 
-LDFLAGS=-e start -Ttext ${ORG} -N -S --oformat binary
+LDFLAGS=-e start -Ttext ${ORG} -N -S --oformat binary $(GLDTARGET)
 
 all: $(PROG)
 
--- a/usr/src/grub/grub-0.97/Makefile.solaris.defs	Mon Nov 18 16:42:05 2019 +0200
+++ b/usr/src/grub/grub-0.97/Makefile.solaris.defs	Sun Nov 24 23:09:59 2019 +0000
@@ -2,6 +2,7 @@
 # Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 # Copyright 2016 Nexenta Systems, Inc.
+# Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
 #
 include $(SRC)/Makefile.master
 
@@ -70,6 +71,7 @@
 		  $(t.ENVCPPFLAGS4:I,%=-nostdinc -isystem %)
 
 CCLD		= $(GNU_ROOT)/bin/gld
+GLDTARGET	= -melf_i386_sol2
 LDFLAGS		= $(BASE_LDFLAGS)
 LINKFLAGS	= -g
 LINK		= $(CCLD) $(LINKFLAGS) $(LDFLAGS)
--- a/usr/src/grub/grub-0.97/stage1/Makefile.solaris	Mon Nov 18 16:42:05 2019 +0200
+++ b/usr/src/grub/grub-0.97/stage1/Makefile.solaris	Sun Nov 24 23:09:59 2019 +0000
@@ -2,7 +2,7 @@
 # Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
-# ident	"%Z%%M%	%I%	%E% SMI"
+# Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
 #
 include ../../Makefile.grub
 include ../Makefile.solaris.defs
@@ -13,10 +13,9 @@
 .exec:
 	$(OBJCOPY) -O binary $< $@
 
-
 INCLUDES	= -I. -I..
 CCASFLAGS	+= -O2 -fno-builtin -nostdinc
-LDFLAGS		+= -nostdlib -N -Ttext 7C00
+LDFLAGS		+= -nostdlib -N -Ttext 7C00 $(GLDTARGET)
 LIBS		=
 
 
--- a/usr/src/grub/grub-0.97/stage2/Makefile.solaris	Mon Nov 18 16:42:05 2019 +0200
+++ b/usr/src/grub/grub-0.97/stage2/Makefile.solaris	Sun Nov 24 23:09:59 2019 +0000
@@ -4,6 +4,7 @@
 # Copyright (c) 2013 by Saso Kiselkov. All rights reserved.
 # Copyright 2015, OmniTI Computer Consulting, Inc. All rights reserved.
 # Copyright 2016 Nexenta Systems, Inc.
+# Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
 #
 include ../../Makefile.grub
 include ../Makefile.solaris.defs
@@ -43,12 +44,12 @@
 $(STAGE2_NETBOOT)STAGE2_CFLAGS	+= $(NETBOOT_CFLAGS)
 #STAGE2_CFLAGS	+= $(HERCULES_CFLAGS)
 
-NBLOADER_LINK	= -nostdlib -N -Ttext 0
-PRE_STAGE2_LINK	= -nostdlib -N -Ttext 8200
-PXELOADER_LINK	= -nostdlib -N -Ttext 7C00
-STAGE1_5_LINK	= -nostdlib -N -Ttext 2000
-START_ELTORITO_LINK = -nostdlib -N -Ttext 7C00
-START_LINK	= -nostdlib -N -Ttext 8000
+NBLOADER_LINK	= -nostdlib -N -Ttext 0 $(GLDTARGET)
+PRE_STAGE2_LINK	= -nostdlib -N -Ttext 8200 $(GLDTARGET)
+PXELOADER_LINK	= -nostdlib -N -Ttext 7C00 $(GLDTARGET)
+STAGE1_5_LINK	= -nostdlib -N -Ttext 2000 $(GLDTARGET)
+START_ELTORITO_LINK = -nostdlib -N -Ttext 7C00 $(GLDTARGET)
+START_LINK	= -nostdlib -N -Ttext 8000 $(GLDTARGET)
 
 LIBDRIVERS	= ../netboot/libdrivers.a
 
@@ -446,13 +447,13 @@
 			  reiserfs_stage1_5_exec-fsys_reiserfs.o \
 			  reiserfs_stage1_5_exec-moddiv.o \
 			  reiserfs_stage1_5_exec-stage1_5.o
- 
+
 $(REISERFS_STAGE1_5_EXEC) := LDFLAGS = $(BASE_LDFLAGS) $(STAGE1_5_LINK)
- 
+
 $(REISERFS_STAGE1_5_ASMOBJS) := CCASFLAGS = $(BASE_CCASFLAGS) \
 				$(STAGE1_5_CFLAGS) \
 				-DFSYS_REISERFS=1 -DNO_BLOCK_FILES=1
- 
+
 $(REISERFS_STAGE1_5_OBJS) := CFLAGS = $(BASE_CFLAGS) $(STAGE1_5_CFLAGS)	\
 				-DFSYS_REISERFS=1 -DNO_BLOCK_FILES=1
 
@@ -678,7 +679,7 @@
 #
 # Diskless
 #
-$(DISKLESS_EXEC): $(DISKLESS_ASMOBJS) $(DISKLESS_OBJS) 
+$(DISKLESS_EXEC): $(DISKLESS_ASMOBJS) $(DISKLESS_OBJS)
 	$(RM) $@
 	$(LINK) -o $@ $(DISKLESS_ASMOBJS) $(DISKLESS_OBJS) $(LIBS)