Skip to content

Commit

Permalink
libtool: Rework the patch and update from version 2.4.6 to 2.4.7
Browse files Browse the repository at this point in the history
  • Loading branch information
Dennisbonke committed Oct 3, 2022
1 parent fecc0e7 commit 2988563
Show file tree
Hide file tree
Showing 4 changed files with 166 additions and 78 deletions.
19 changes: 12 additions & 7 deletions bootstrap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -373,19 +373,24 @@ tools:
name: libtool
subdir: 'ports'
git: 'https://git.savannah.gnu.org/git/libtool.git'
tag: 'v2.4.6'
version: '2.4.6'
tag: 'v2.4.7'
version: '2.4.7'
tools_required:
- host-autoconf-v2.69
- host-automake-v1.15
- host-autoconf-v2.71
- host-automake-v1.16
regenerate:
# libtool's ./bootstrap does a shallow clone with insufficient depth.
- args: ['git', 'submodule', 'update', '--init']
- args: ['./bootstrap']
- args: ['cp',
'@BUILD_ROOT@/tools/host-automake-v1.16/share/automake-1.16/config.sub',
'@THIS_SOURCE_DIR@/build-aux/']
- args: ['cp',
'@BUILD_ROOT@/tools/host-automake-v1.16/share/automake-1.16/config.guess',
'@THIS_SOURCE_DIR@/build-aux/']
tools_required:
- host-autoconf-v2.69
- host-automake-v1.15
revision: 2
- host-autoconf-v2.71
- host-automake-v1.16
configure:
- args:
- '@THIS_SOURCE_DIR@/configure'
Expand Down
154 changes: 154 additions & 0 deletions patches/libtool/0001-Add-Managarm-support.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
From 7a54602435d2750d63e670923977e365da7a7acf Mon Sep 17 00:00:00 2001
From: Dennis Bonke <[email protected]>
Date: Mon, 3 Oct 2022 20:55:31 +0200
Subject: [PATCH] Add Managarm support

Signed-off-by: Dennis Bonke <[email protected]>
---
build-aux/ltmain.in | 2 +-
libtoolize.in | 2 +-
m4/libtool.m4 | 38 +++++++++++++++++++++++++++++++++++++-
m4/ltdl.m4 | 3 +++
4 files changed, 42 insertions(+), 3 deletions(-)

diff --git a/build-aux/ltmain.in b/build-aux/ltmain.in
index a5f21a1..c06d55c 100644
--- a/build-aux/ltmain.in
+++ b/build-aux/ltmain.in
@@ -6497,7 +6497,7 @@ func_mode_link ()
fi
else
# We cannot seem to hardcode it, guess we'll fake it.
- add_dir=-L$libdir
+ add_dir=-L$lt_sysroot$libdir
# Try looking first in the location we're being installed to.
if test -n "$inst_prefix_dir"; then
case $libdir in
diff --git a/libtoolize.in b/libtoolize.in
index 0c40fed..763619b 100644
--- a/libtoolize.in
+++ b/libtoolize.in
@@ -1891,7 +1891,7 @@ func_require_seen_libtool ()
# Do not remove config.guess, config.sub or install-sh, we don't
# install them without --install, and the project may not be using
# Automake. Similarly, do not remove Gnulib files.
- all_pkgaux_files="compile depcomp missing ltmain.sh"
+ all_pkgaux_files=""
all_pkgmacro_files="libtool.m4 ltargz.m4 ltdl.m4 ltoptions.m4 ltsugar.m4 ltversion.in ltversion.m4 lt~obsolete.m4"
all_pkgltdl_files="COPYING.LIB Makefile Makefile.in Makefile.inc Makefile.am README acinclude.m4 aclocal.m4 argz_.h argz.c config.h.in config-h.in configure configure.ac configure.in libltdl/lt__alloc.h libltdl/lt__argz.h libltdl/lt__dirent.h libltdl/lt__glibc.h libltdl/lt__private.h libltdl/lt__strl.h libltdl/lt_dlloader.h libltdl/lt_error.h libltdl/lt_system.h libltdl/slist.h loaders/dld_link.c loaders/dlopen.c loaders/dyld.c loaders/load_add_on.c loaders/loadlibrary.c loaders/preopen.c loaders/shl_load.c lt__alloc.c lt__argz.c lt__dirent.c lt__strl.c lt_dlloader.c lt_error.c ltdl.c ltdl.h ltdl.mk slist.c"

diff --git a/m4/libtool.m4 b/m4/libtool.m4
index 79a2451..4e0e43d 100644
--- a/m4/libtool.m4
+++ b/m4/libtool.m4
@@ -1696,7 +1696,7 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
lt_cv_sys_max_cmd_len=12288; # 12K is about right
;;

- gnu*)
+ gnu* | managarm*)
# Under GNU Hurd, this test is not required because there is
# no limit to the length of command line arguments.
# Libtool will interpret -1 as no limit whatsoever
@@ -2925,6 +2925,18 @@ netbsd*)
hardcode_into_libs=yes
;;

+managarm*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ dynamic_linker='mlibc ld.so'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
newsos6)
version_type=linux # correct to gnu/linux during the next big refactor
library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
@@ -3566,6 +3578,10 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
lt_cv_deplibs_check_method=pass_all
;;

+managarm*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
netbsd*)
if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
@@ -4446,6 +4462,8 @@ m4_if([$1], [CXX], [
;;
netbsd*)
;;
+ managarm*)
+ ;;
*qnx* | *nto*)
# QNX uses GNU C++, but need to define -shared option too, otherwise
# it will coredump.
@@ -4618,6 +4636,12 @@ m4_if([$1], [CXX], [
enable_shared=no
;;

+ managarm*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
+
*nto* | *qnx*)
# QNX uses GNU C++, but need to define -shared option too, otherwise
# it will coredump.
@@ -5273,6 +5297,11 @@ _LT_EOF
fi
;;

+ managarm*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+ ;;
+
netbsd*)
if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
@@ -5815,6 +5844,9 @@ _LT_EOF
esac
;;

+ managarm*)
+ ;;
+
netbsd*)
if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
@@ -7115,6 +7147,10 @@ if test yes != "$_lt_caught_CXX_error"; then
esac
;;

+ managarm*)
+ _LT_TAGVAR(ld_shlibs, $1)=yes
+ ;;
+
netbsd*)
if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
diff --git a/m4/ltdl.m4 b/m4/ltdl.m4
index 772c150..b0dbf78 100644
--- a/m4/ltdl.m4
+++ b/m4/ltdl.m4
@@ -497,6 +497,9 @@ AC_CACHE_CHECK([whether deplibs are loaded by dlopen],
# at 6.2 and later dlopen does load deplibs.
lt_cv_sys_dlopen_deplibs=yes
;;
+ managarm*)
+ lt_cv_sys_dlopen_deplibs=yes
+ ;;
netbsd*)
lt_cv_sys_dlopen_deplibs=yes
;;
--
2.37.2

26 changes: 0 additions & 26 deletions patches/libtool/0001-Fix-lt_sysroot.patch

This file was deleted.

45 changes: 0 additions & 45 deletions patches/libtool/0002-Fill-in-managarm-characteristics.patch

This file was deleted.

0 comments on commit 2988563

Please sign in to comment.