[Top][All Lists]

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

Fix module loading for OpenBSD

From: Christian Weisgerber
Subject: Fix module loading for OpenBSD
Date: Thu, 8 Dec 2022 20:10:37 +0100

Dynamic loading of modules is broken on OpenBSD:

bash-5.2$ enable finfo
bash:/usr/local/lib/bash/finfo: undefined symbol 'sh_optind'
bash:/usr/local/lib/bash/finfo: undefined symbol 'sh_optarg'
bash: enable: finfo: not a shell builtin

This is trivially fixed, configure simply needs to add -rdynamic to
the build flags.

The FreeBSD entry is also bizarrely obsolete.  a.out hasn't been
a thing forever; freebsdelf must have been experimental if it ever
even existed; freebsd[3-9] fails to capture freebsd10 and above--
the oldest supported FreeBSD branch is 12.x right now.  All this
also leaves bash without functioning module loading when built on
a recent FreeBSD.  A simple "freebsd*) LOCAL_LDFLAGS=-rdynamic ;;"
entry would make more sense.

--- configure.ac.orig   Thu Dec  8 16:56:15 2022
+++ configure.ac        Thu Dec  8 16:56:38 2022
@@ -1197,16 +1197,17 @@
 dnl FreeBSD-3.x can have either a.out or ELF
 case "${host_os}" in
                if test -x /usr/bin/objformat && test "`/usr/bin/objformat`" = 
"elf" ; then
                        LOCAL_LDFLAGS=-rdynamic # allow dynamic loading
                fi ;;
 freebsdelf*)   LOCAL_LDFLAGS=-rdynamic ;;      # allow dynamic loading
 dragonfly*)    LOCAL_LDFLAGS=-rdynamic ;;      # allow dynamic loading
+openbsd*)      LOCAL_LDFLAGS=-rdynamic ;;      # allow dynamic loading
 midnightbsd*)  LOCAL_LDFLAGS=-rdynamic ;;      # allow dynamic loading
 case "$host_cpu" in
 *cray*)                LOCAL_CFLAGS="-DCRAY" ;; # shell var so config.h can 
use it
 case "$host_cpu-$host_os" in
Christian "naddy" Weisgerber                          naddy@mips.inka.de

reply via email to

[Prev in Thread] Current Thread [Next in Thread]