Hi,

> http://build-failures.rhaalovely.net/mips64/2021-07-26/archivers/innoextract.log

I'm feeling compelled to fix my own mistake here :)

Back in the days this error has popped out on macppc, i had some very
low hope for mips64 to have libexecinfo support one day and as such
limited the fix to macppc.

The problem here is due `-Wl,--as-needed' that tends to misbehave on
ld.bfd archs, the whole explanation is in the diff actually.

In order to make it universal for all clang+ld.bfd archs, i'm proposing
to disable optimisations for these archs through PROPERTIES, so if
sparc64 joins the gang one day, there is no further things to do.

It's doing more than the patch used to do, hence a REVISION bump.
If really wanted i can provide a NO_AS_NEEDED option that would involve
only the removal of the linker flag. I'm not sure what is the best
course of action.

I've tested on macppc where it builds OK; there is no changes for
clang+ld.lld archs. I've no mips64 machine, so i can't test.

Comments and feedback are welcome,

Charlène.


Index: Makefile
===================================================================
RCS file: /cvs/ports/archivers/innoextract/Makefile,v
retrieving revision 1.17
diff -u -p -u -p -r1.17 Makefile
--- Makefile    5 Nov 2020 11:23:30 -0000       1.17
+++ Makefile    6 Aug 2021 13:34:30 -0000
@@ -3,7 +3,7 @@
 COMMENT=       unpack Inno Setup installers
 
 DISTNAME=      innoextract-1.9
-REVISION=      0
+REVISION=      1
 CATEGORIES=    archivers
 HOMEPAGE=      https://constexpr.org/innoextract/
 MAINTAINER=    Thomas Frohwein <t...@openbsd.org>
@@ -37,6 +37,17 @@ CONFIGURE_ARGS+=-DCMAKE_INSTALL_PREFIX="
                -DDOXYGEN_EXECUTABLE="false"
 
 NO_TEST=       Yes
+
+.include <bsd.port.arch.mk>
+
+# Drop -Wl,--as-needed causes the std::unique_ptr test to fail on ld.bfd archs
+# using base-clang due to undefined reference errors, and user supplied linker
+# flags are removed during the test. A fallback exists, using std::auto_ptr,
+# but it has been disabled by C++17. Use the same code as other archs instead
+# of reenabling std::auto_ptr.
+.if ${PROPERTIES:Mclang} && !${PROPERTIES:Mlld}
+CONFIGURE_ARGS+=       -DSET_OPTIMIZATION_FLAGS=OFF
+.endif
 
 do-install:
        ${INSTALL_PROGRAM} ${WRKBUILD}/innoextract ${PREFIX}/bin
Index: patches/patch-cmake_BuildType_cmake
===================================================================
RCS file: patches/patch-cmake_BuildType_cmake
diff -N patches/patch-cmake_BuildType_cmake
--- patches/patch-cmake_BuildType_cmake 15 Dec 2020 19:38:22 -0000      1.1
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,24 +0,0 @@
-$OpenBSD: patch-cmake_BuildType_cmake,v 1.1 2020/12/15 19:38:22 cwen Exp $
-
-Fix the build on powerpc.
-Should be reviewed once lld becomes the default linker on powerpc
-
-Index: cmake/BuildType.cmake
---- cmake/BuildType.cmake.orig
-+++ cmake/BuildType.cmake
-@@ -301,6 +301,15 @@ else(MSVC)
-               if(MACOS)
-                       # TODO For some reason this check succeeds on macOS, 
but then
-                       # flag causes the actual build to fail :(
-+              elseif(CMAKE_SYSTEM_NAME STREQUAL "OpenBSD"
-+                     AND CMAKE_SYSTEM_PROCESSOR STREQUAL "powerpc")
-+                      # XXX Need a review once lld is the default linker on 
powerpc
-+                      # -Wl,--as-needed causes the std::unique_ptr test to
-+                      # fail due to undefined reference errors, and user
-+                      # supplied linker flags are removed during the test. A
-+                      # fallback exists, using std::auto_ptr, but it has been
-+                      # disabled by C++17. Use the same code as other archs
-+                      # instead of reenabling std::auto_ptr.
-               else()
-                       # Link as few libraries as possible
-                       # This is much easier than trying to decide which 
libraries are needed for each


Reply via email to