diff mbox series

config/x86: tidy {Free,Open}BSD LDFLAGS_DIRECT handling

Message ID cdaf00fc-d0ca-988f-565a-1fef3ae203e5@suse.com (mailing list archive)
State New, archived
Headers show
Series config/x86: tidy {Free,Open}BSD LDFLAGS_DIRECT handling | expand

Commit Message

Jan Beulich Aug. 11, 2022, 12:14 p.m. UTC
It's not clear why for x86-64 a different approach was used than the
(shorter) one x86-32 has been using. Move the LDFLAGS_DIRECT_*BSD
setting to the respective OS files and reuse x86-32's approach for
x86-64.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
I was actually inclined to go further and rename the variable(s) as
well, to e.g. XEN_ELF_SUB_FLAVOR, at the same time eliminating the
indirection via $(XEN_OS).

Comments

Andrew Cooper Aug. 11, 2022, 3:18 p.m. UTC | #1
On 11/08/2022 13:14, Jan Beulich wrote:
> It's not clear why for x86-64 a different approach was used than the
> (shorter) one x86-32 has been using. Move the LDFLAGS_DIRECT_*BSD
> setting to the respective OS files and reuse x86-32's approach for
> x86-64.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>

> ---
> I was actually inclined to go further and rename the variable(s) as
> well, to e.g. XEN_ELF_SUB_FLAVOR, at the same time eliminating the
> indirection via $(XEN_OS).

Yeah, that looks neater.  My ack stands either way.
diff mbox series

Patch

--- a/config/FreeBSD.mk
+++ b/config/FreeBSD.mk
@@ -1,5 +1,7 @@ 
 include $(XEN_ROOT)/config/StdGNU.mk
 
+LDFLAGS_DIRECT_FreeBSD = _fbsd
+
 # No wget on FreeBSD base system
 WGET = ftp
 PKG_INSTALLDIR = ${prefix}/libdata/pkgconfig
--- a/config/OpenBSD.mk
+++ b/config/OpenBSD.mk
@@ -1 +1,3 @@ 
 include $(XEN_ROOT)/config/StdGNU.mk
+
+LDFLAGS_DIRECT_OpenBSD = _obsd
--- a/config/x86_32.mk
+++ b/config/x86_32.mk
@@ -8,8 +8,6 @@  CONFIG_XCUTILS := y
 CFLAGS += -m32 -march=i686
 
 # Use only if calling $(LD) directly.
-LDFLAGS_DIRECT_OpenBSD = _obsd
-LDFLAGS_DIRECT_FreeBSD = _fbsd
 LDFLAGS_DIRECT += -melf_i386$(LDFLAGS_DIRECT_$(XEN_OS))
 
 IOEMU_CPU_ARCH ?= i386
--- a/config/x86_64.mk
+++ b/config/x86_64.mk
@@ -14,14 +14,6 @@  SunOS_LIBDIR = $(SunOS_LIBDIR_x86_64)
 EFI_DIR ?= /usr/lib64/efi
 
 # Use only if calling $(LD) directly.
-ifeq ($(XEN_OS),OpenBSD)
-LDFLAGS_DIRECT += -melf_x86_64_obsd
-else
-ifeq ($(XEN_OS),FreeBSD)
-LDFLAGS_DIRECT += -melf_x86_64_fbsd
-else
-LDFLAGS_DIRECT += -melf_x86_64
-endif
-endif
+LDFLAGS_DIRECT += -melf_x86_64$(LDFLAGS_DIRECT_$(XEN_OS))
 
 IOEMU_CPU_ARCH ?= x86_64