tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: AIX 7.2 with current - bmake expecting ELF binary?



> Date: Wed, 26 Jun 2024 11:08:42 -0400
> From: Louis Guillaume <louis%zabrico.com@localhost>
> 
> # bmake package-install
> ERROR: [depends.mk] Installed package digest-20220214 has an
> ERROR:     object format ``XCOFF'' which differs from ``ELF''.  Please
> ERROR:     update the digest-20220214 package to ELF.
> *** Error code 1
> 
> Is there a platform variable that affects this, which may have recently 
> been reset? The object format *should* be XCOFF for AIX, AFAIK.

This is a bug in bootstrap-mk-files bsd.own.mk, which wrongly sets
OBJECT_FMT=ELF.  We had a workaround in pkgsrc/mk/bsd.prefs.mk which
broke when I brought in some cross-compilation changes a few months
ago to split OPSYS from NATIVE_OPSYS, and I adapted the workaround for
Cygwin when someone tripped over it earlier this month in PR pkg/58315
(https://gnats.NetBSD.org/58315):

https://mail-index.netbsd.org/pkgsrc-changes/2024/06/05/msg301291.html

Should really properly fix it in bootstrap-mk-files, but it would be
nice not to have to duplicate the information for both native and
cross builds, and I haven't thought of a good way to do it yet.

For now, I'd just try the attached patch to the workaround.
diff --git a/mk/bsd.prefs.mk b/mk/bsd.prefs.mk
index 7f2de0127caf..20916f04503c 100644
--- a/mk/bsd.prefs.mk
+++ b/mk/bsd.prefs.mk
@@ -409,7 +409,10 @@ TARGET_MACHINE_PLATFORM=	${TARGET_OPSYS}-${TARGET_OS_VERSION}-${TARGET_MACHINE_A
 # or Cygwin (XXX or HP-UX or AIX or OSF/1 or ...).
 #
 # We will later set OBJECT_FMT to be conditional on USE_CROSS_COMPILE.
-.if ${NATIVE_OPSYS} == "Cygwin"
+.if ${NATIVE_OPSYS} == "AIX"
+NATIVE_OBJECT_FMT?=	XCOFF
+OBJECT_FMT?=		XCOFF
+.elif ${NATIVE_OPSYS} == "Cygwin"
 NATIVE_OBJECT_FMT?=	PE
 OBJECT_FMT?=		PE
 .elif ${NATIVE_OPSYS} == "Darwin"


Home | Main Index | Thread Index | Old Index