From: Robert Dubner <[email protected]>
Date: Tue, 20 Oct 2026 14:00:49 -0400
Subject: [PATCH] cobol: Make --disable-libgcobol-rpath the default
configuration option.
By making --disable-libgcobol-rpath the default configuration option,
COBOL executables will be created without embedded RUNPATH information.
Selecting --enable-libgcobol-rpath during configuration will result in
COBOL executables with RUNPATH information.
The lang_specific_driver change gets rid of a spurious "couldn't
determine version" message at the end of running "make check-cobol".
gcc/cobol/ChangeLog:
* gcobolspec.cc (lang_specific_driver): Set need_libposix to false
when there are no input files.
libgcobol/ChangeLog:
* configure.ac: Make --disable-libgcobol-rpath the default.
* configure: Regenerate.
---
gcc/cobol/gcobolspec.cc | 1 +
libgcobol/configure | 8 ++++----
libgcobol/configure.ac | 6 +++---
3 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/gcc/cobol/gcobolspec.cc b/gcc/cobol/gcobolspec.cc
index 29718a7d565..cefaddd6c77 100644
--- a/gcc/cobol/gcobolspec.cc
+++ b/gcc/cobol/gcobolspec.cc
@@ -428,6 +428,7 @@ lang_specific_driver (struct cl_decoded_option
**in_decoded_options,
if( n_infiles == 0 )
{
need_libgcobol = false;
+ need_libposix = false;
need_libdl = false;
need_libstdc = false;
}
diff --git a/libgcobol/configure b/libgcobol/configure
index a03c8cd67ab..32cb45a6c56 100755
--- a/libgcobol/configure
+++ b/libgcobol/configure
@@ -1466,9 +1466,9 @@ Optional Features:
install libraries with @rpath/library-name,
requires
rpaths to be added to executables
--disable-rpath do not hardcode runtime library paths
- --disable-libgcobol-rpath
- do not embed the native Linux libgcobol
installation
- directory in RUNPATH
+ --enable-libgcobol-rpath
+ embed the native Linux libgcobol installation
+ directory in RUNPATH (default: no)
--disable-libquadmath disable libquadmath support for libgcobol
Optional Packages:
@@ -17704,7 +17704,7 @@ if test "${enable_libgcobol_rpath+set}" = set;
then :
*) as_fn_error $? "--enable-libgcobol-rpath expects yes or no"
"$LINENO" 5 ;;
esac
else
- enable_libgcobol_rpath=yes
+ enable_libgcobol_rpath=no
fi
LIBGCOBOL_RPATH_SPEC=
diff --git a/libgcobol/configure.ac b/libgcobol/configure.ac
index 9c929548342..270e4d73c6e 100644
--- a/libgcobol/configure.ac
+++ b/libgcobol/configure.ac
@@ -208,13 +208,13 @@ AC_SUBST(extra_ldflags_libgcobol)
# in programs produced by a cross compiler. Native Linux installations
can
# find their runtime without changing the system-wide loader
configuration.
AC_ARG_ENABLE([libgcobol-rpath],
- [AS_HELP_STRING([--disable-libgcobol-rpath],
- [do not embed the native Linux libgcobol installation directory in
RUNPATH])],
+ [AS_HELP_STRING([--enable-libgcobol-rpath],
+ [embed the native Linux libgcobol installation directory in RUNPATH
(default: no)])],
[case $enableval in
yes|no) ;;
*) AC_MSG_ERROR([--enable-libgcobol-rpath expects yes or no]) ;;
esac],
- [enable_libgcobol_rpath=yes])
+ [enable_libgcobol_rpath=no])
LIBGCOBOL_RPATH_SPEC=
case $host in
*-*-linux*)
--
2.34.1