Subject: bug#68179: Re: automake-1.16j on OpenBSD

From: Bogdan <[email-masked]>
Date: Thu, 22 Feb 2024 22:08:35 +0100

Bruno Haible <[email-masked]>, 2024-02-20 12:44:
> Bogdan wrote:
>>    Right. And, as I suspected, nothing in any LIBS, LD*, no libobjc found.
>>    Does it work if you put
>>
>> AC_LANG([Objective C])
>>
>>    somewhere between the lines
>>
>> 	cat >> configure.ac << 'END'
>>
>> and the first
>>
>> 	END
>>
>> following it (i.e., in the 'configure.ac' file) in the test?
>
> No: With this added configure.ac line (before AC_OUTPUT), the
> two tests t/objcxx-minidemo.sh and t/objcxx-deps.sh still fail.
>
>>    If not, do you know any function name that we could use in
>> AC_CHECK_LIB to check for libobjc?

[...]

> ======================================================================
> produces link errors w.r.t. the symbols
>    objc_autoreleasePoolPush
>    objc_autoreleasePoolPop
>    __objc_exec_class
> Is one of them suitable for testing? It depends on the ABI. Looking at
> https://opensource.apple.com/source/objc4/objc4-706/runtime/objc-abi.h.auto.html
> it seems better to choose one of the symbols
>    _objcInit
>    objc_getProperty
>    objc_setProperty
>    objc_setProperty_atomic
>    objc_setProperty_nonatomic
>    ...
>    objc_copyStruct
>    objc_copyCppObjectAtomic
>    _objc_empty_cache
>    ...
>
> But wait! The name of the library 'libobjc' is not standardized either.
>
> I would try to just compile a simple Objective-C++ program and see whether that
> works or not. Such as:

That's what I would expect from Autoconf...
[...]

> =======================================================================
> Missing symbols with clang on OpenBSD:
>    objc_msg_lookup_sender
>    __objc_exec_class
> Missing symbols with clang on Ubuntu:
>    objc_msg_lookup
>    __objc_exec_class

[...]

  Assuming that the library is named "libobjc", I'm attaching a patch
that searches for the above symbols in the library. The tests worked
for me without this, and work after. Feel free to add more rows if the
library name is different.

Gathering the other thread:

 > So, in summary, I suggest to use the option '-x' instead of
'--verbose'.
 > It makes the t/strip2.sh test succeed on OpenBSD. Then you can
remove the comment "This test needs GNU binutils strip.".

Patch attached.

--
Regards - Bogdan ('bogdro') D.                 (GNU/Linux & FreeDOS)
X86 assembly (DOS, GNU/Linux):    http://bogdro.evai.pl/index-en.php
Soft(EN): http://bogdro.evai.pl/soft  http://bogdro.evai.pl/soft4asm
www.Xiph.org  www.TorProject.org  www.LibreOffice.org  www.GnuPG.org
From 06852fb43569eac608b95dea838858cd75e37327 Mon Sep 17 00:00:00 2001
From: Bogdan Drozdowski <>
Date: Thu, 22 Feb 2024 22:03:29 +0100
Subject: [PATCH] Try to fix Objective-c++ on OpenBSD

---
 t/objcxx-deps.sh     | 4 ++++
 t/objcxx-minidemo.sh | 4 ++++
 2 files changed, 8 insertions(+)

diff --git a/t/objcxx-deps.sh b/t/objcxx-deps.sh
index 1f39507fd..519c33244 100644
--- a/t/objcxx-deps.sh
+++ b/t/objcxx-deps.sh
@@ -21,6 +21,10 @@
 
 cat >> configure.ac << 'END'
 AC_PROG_OBJCXX
+AC_CHECK_LIB([objc],[__objc_exec_class])
+AC_CHECK_LIB([objc],[objc_getProperty])
+AC_CHECK_LIB([objc],[objc_msg_lookup_sender])
+AC_CHECK_LIB([objc],[objc_msg_lookup])
 AC_OUTPUT
 END
 
diff --git a/t/objcxx-minidemo.sh b/t/objcxx-minidemo.sh
index ec0e8e129..f6f53c151 100644
--- a/t/objcxx-minidemo.sh
+++ b/t/objcxx-minidemo.sh
@@ -23,6 +23,10 @@ required=native
 cat >> configure.ac << 'END'
 AC_PROG_OBJCXX
 AC_CONFIG_HEADERS([config.h])
+AC_CHECK_LIB([objc],[__objc_exec_class])
+AC_CHECK_LIB([objc],[objc_getProperty])
+AC_CHECK_LIB([objc],[objc_msg_lookup_sender])
+AC_CHECK_LIB([objc],[objc_msg_lookup])
 AC_OUTPUT
 END
 
-- 
2.35.1

From 4005c0dee31133571c31e79fb5c248731e135f0c Mon Sep 17 00:00:00 2001
From: Bogdan Drozdowski <>
Date: Thu, 22 Feb 2024 21:01:39 +0100
Subject: [PATCH] Fix strip on OpenBSD and others

---
 t/strip2.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/t/strip2.sh b/t/strip2.sh
index a367dd0fe..e48dddc7a 100644
--- a/t/strip2.sh
+++ b/t/strip2.sh
@@ -15,7 +15,7 @@
 # along with this program.  If not, see <https://www.gnu.org/licenses/>.
 
 # Ensure install-strip works when STRIP consists of more than one word.
-# This test needs GNU binutils strip.  See sister test 'strip3.sh'.
+# See sister test 'strip3.sh'.
 
 required='cc strip'
 . test-init.sh
@@ -39,7 +39,7 @@ $ACLOCAL
 $AUTOCONF
 $AUTOMAKE -a
 
-./configure --prefix="$(pwd)/inst" STRIP='strip --verbose'
+./configure --prefix="$(pwd)/inst" STRIP='strip -x'
 $MAKE
 $MAKE install-strip
 
-- 
2.35.1