Skip to content

Commit 605fa7c

Browse files
committed
ports: Misc backports
1 parent 4bbc98e commit 605fa7c

24 files changed

+139
-117
lines changed

GNUmakefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ debug:
1919
JINX_CONFIG_FILE=jinx-config-debug $(MAKE) all
2020

2121
jinx:
22-
curl -Lo jinx https://github.com/mintsuki/jinx/raw/ae57b8322c949c41a9582c8f5ed47187587c0f7b/jinx
22+
curl -Lo jinx https://github.com/mintsuki/jinx/raw/40cf99e0967849e12feb480163202005e3a9bf57/jinx
2323
chmod +x jinx
2424

2525
.PHONY: distro-full

build-support/CMakeToolchain.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ set(CMAKE_SYSTEM_NAME Vinix)
22

33
set(CMAKE_FIND_ROOT_PATH /sysroot)
44

5-
set(CMAKE_C_COMPILER x86_64-vinix-gcc)
6-
set(CMAKE_CXX_COMPILER x86_64-vinix-g++)
5+
set(CMAKE_C_COMPILER x86_64-pc-vinix-mlibc-gcc)
6+
set(CMAKE_CXX_COMPILER x86_64-pc-vinix-mlibc-g++)
77

88
# search for programs in the build host directories
99
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)

build-support/cross_file.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
[binaries]
2-
c = 'x86_64-vinix-gcc'
3-
cpp = 'x86_64-vinix-g++'
4-
ar = 'x86_64-vinix-ar'
5-
nm = 'x86_64-vinix-nm'
6-
strip = 'x86_64-vinix-strip'
7-
pkg-config = 'x86_64-vinix-pkg-config'
2+
c = 'x86_64-pc-vinix-mlibc-gcc'
3+
cpp = 'x86_64-pc-vinix-mlibc-g++'
4+
ar = 'x86_64-pc-vinix-mlibc-ar'
5+
nm = 'x86_64-pc-vinix-mlibc-nm'
6+
strip = 'x86_64-pc-vinix-mlibc-strip'
7+
pkg-config = 'x86_64-pc-vinix-mlibc-pkg-config'
88
llvm-config = '/base_dir/build-support/cross-llvm-config'
99

1010
[host_machine]

jinx-config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ JINX_MAJOR_VER=0.2
33
export CFLAGS="-O2 -pipe -march=x86-64 -mtune=generic"
44
export CXXFLAGS="${CFLAGS}"
55

6-
OS_TRIPLET=x86_64-vinix
6+
OS_TRIPLET=x86_64-pc-vinix-mlibc
77

88
post_package_strip() {
99
if [ -z "$strip_command" ]; then
Lines changed: 42 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
diff --git autoconf-clean/build-aux/config.guess autoconf-workdir/build-aux/config.guess
2-
index cdfc439..0e1b56a 100755
2+
index cdfc439..02e3643 100755
33
--- autoconf-clean/build-aux/config.guess
44
+++ autoconf-workdir/build-aux/config.guess
55
@@ -4,7 +4,8 @@
@@ -12,18 +12,21 @@ index cdfc439..0e1b56a 100755
1212

1313
# This file is free software; you can redistribute it and/or modify it
1414
# under the terms of the GNU General Public License as published by
15-
@@ -933,6 +934,9 @@ EOF
16-
i*:PW*:*)
17-
GUESS=$UNAME_MACHINE-pc-pw32
15+
@@ -976,6 +977,12 @@ EOF
16+
*:[Mm]anagarm:*:*)
17+
GUESS="$UNAME_MACHINE-unknown-managarm-mlibc"
1818
;;
19-
+ *:Vinix:*:*)
20-
+ GUESS=$UNAME_MACHINE-pc-vinix
19+
+ x86_64:[Vv]inix:*:*|i?86:[Vv]inix:*:*)
20+
+ GUESS="$UNAME_MACHINE-pc-vinix-mlibc"
2121
+ ;;
22-
*:SerenityOS:*:*)
23-
GUESS=$UNAME_MACHINE-pc-serenity
24-
;;
22+
+ *:[Vv]inix:*:*)
23+
+ GUESS="$UNAME_MACHINE-unknown-vinix-mlibc"
24+
+ ;;
25+
*:Minix:*:*)
26+
GUESS=$UNAME_MACHINE-unknown-minix
27+
;;
2528
diff --git autoconf-clean/build-aux/config.sub autoconf-workdir/build-aux/config.sub
26-
index defe52c..8600125 100755
29+
index defe52c..426e8de 100755
2730
--- autoconf-clean/build-aux/config.sub
2831
+++ autoconf-workdir/build-aux/config.sub
2932
@@ -4,7 +4,8 @@
@@ -36,12 +39,32 @@ index defe52c..8600125 100755
3639

3740
# This file is free software; you can redistribute it and/or modify it
3841
# under the terms of the GNU General Public License as published by
39-
@@ -1749,7 +1750,7 @@ case $os in
40-
| mirbsd* | netbsd* | dicos* | openedition* | ose* \
41-
| bitrig* | openbsd* | secbsd* | solidbsd* | libertybsd* | os108* \
42-
| ekkobsd* | freebsd* | riscix* | lynxos* | os400* \
43-
- | bosx* | nextstep* | cxux* | oabi* \
44-
+ | bosx* | nextstep* | cxux* | oabi* | vinix* \
45-
| ptx* | ecoff* | winnt* | domain* | vsta* \
46-
| udi* | lites* | ieee* | go32* | aux* | hcos* \
47-
| chorusrdb* | cegcc* | glidix* | serenity* \
42+
@@ -145,7 +146,7 @@ case $1 in
43+
nto-qnx* | linux-* | uclinux-uclibc* \
44+
| uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \
45+
| netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \
46+
- | storm-chaos* | os2-emx* | rtmk-nova* | managarm-* \
47+
+ | storm-chaos* | os2-emx* | rtmk-nova* | managarm-* | vinix-* \
48+
| windows-* )
49+
basic_machine=$field1
50+
basic_os=$maybe_os
51+
@@ -1325,6 +1326,10 @@ EOF
52+
kernel=managarm
53+
os=`echo "$basic_os" | sed -e 's|managarm|mlibc|'`
54+
;;
55+
+ vinix*)
56+
+ kernel=vinix
57+
+ os=`echo "$basic_os" | sed -e 's|vinix|mlibc|'`
58+
+ ;;
59+
*)
60+
kernel=
61+
os=$basic_os
62+
@@ -1825,6 +1830,8 @@ case $kernel-$os-$obj in
63+
;;
64+
managarm-mlibc*- | managarm-kernel*- )
65+
;;
66+
+ vinix-mlibc*- )
67+
+ ;;
68+
windows*-msvc*-)
69+
;;
70+
-dietlibc*- | -newlib*- | -musl*- | -relibc*- | -uclibc*- | -mlibc*- )

patches/binutils/jinx-working-patch.patch

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,3 @@
1-
diff --git binutils-clean/bfd/Makefile.am binutils-workdir/bfd/Makefile.am
2-
index 5c5fdef..3c91651 100644
3-
--- binutils-clean/bfd/Makefile.am
4-
+++ binutils-workdir/bfd/Makefile.am
5-
@@ -778,7 +778,7 @@ ofiles: stamp-ofiles ; @true
6-
libbfd_la_SOURCES = $(BFD32_LIBS_CFILES)
7-
EXTRA_libbfd_la_SOURCES = $(CFILES)
8-
libbfd_la_DEPENDENCIES = $(OFILES) ofiles ../libsframe/libsframe.la
9-
-libbfd_la_LIBADD = `cat ofiles` @SHARED_LIBADD@ $(LIBDL) $(ZLIB) $(ZSTD_LIBS) ../libsframe/libsframe.la
10-
+libbfd_la_LIBADD = `cat ofiles` @SHARED_LIBADD@ $(LIBDL) $(ZLIB) $(ZSTD_LIBS) $(SFRAME_LIB_PATH) ../libsframe/libsframe.la
11-
libbfd_la_LDFLAGS += -release `cat libtool-soversion` @SHARED_LDFLAGS@
12-
13-
# This file holds an array associating configuration triplets and
141
diff --git binutils-clean/bfd/config.bfd binutils-workdir/bfd/config.bfd
152
index bdee539..f5d0cf0 100644
163
--- binutils-clean/bfd/config.bfd

patches/gcc-host/jinx-working-patch.patch

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
diff --git gcc-host-clean/fixincludes/mkfixinc.sh gcc-host-workdir/fixincludes/mkfixinc.sh
2-
index df90720..da6408a 100755
2+
index df90720..484f8bc 100755
33
--- gcc-host-clean/fixincludes/mkfixinc.sh
44
+++ gcc-host-workdir/fixincludes/mkfixinc.sh
55
@@ -12,6 +12,7 @@ target=fixinc.sh
66
# Check for special fix rules for particular targets
77
case $machine in
88
i?86-*-cygwin* | \
9-
+ x86_64-*-vinix* | \
9+
+ *-*-*-mlibc | \
1010
i?86-*-mingw32* | \
1111
x86_64-*-mingw32* | \
1212
powerpc-*-eabisim* | \
1313
diff --git gcc-host-workdir/gcc/config/vinix.h gcc-host-workdir/gcc/config/vinix.h
1414
new file mode 100644
15-
index 0000000..be79aae
15+
index 0000000..ca776e9
1616
--- /dev/null
1717
+++ gcc-host-workdir/gcc/config/vinix.h
1818
@@ -0,0 +1,29 @@
@@ -46,14 +46,14 @@ index 0000000..be79aae
4646
+ builtin_assert ("system=posix"); \
4747
+ } while (0);
4848
diff --git gcc-host-clean/gcc/config.gcc gcc-host-workdir/gcc/config.gcc
49-
index 648b3dc..f2b0217 100644
49+
index 648b3dc..a709885 100644
5050
--- gcc-host-clean/gcc/config.gcc
5151
+++ gcc-host-workdir/gcc/config.gcc
5252
@@ -840,6 +840,15 @@ case ${target} in
5353
tmake_file="${tmake_file} t-freebsd"
5454
target_has_targetdm=yes
5555
;;
56-
+*-*-vinix*)
56+
+*-*-*-mlibc)
5757
+ extra_options="$extra_options gnu-user.opt"
5858
+ gas=yes
5959
+ gnu_ld=yes
@@ -76,15 +76,15 @@ index 648b3dc..f2b0217 100644
7676
tmake_file="${tmake_file} i386/t-x86_64-elf"
7777
tm_file="${tm_file} i386/unix.h i386/att.h elfos.h newlib-stdint.h i386/i386elf.h i386/x86-64.h fuchsia.h"
7878
diff --git gcc-host-clean/libgcc/config.host gcc-host-workdir/libgcc/config.host
79-
index 9d72120..b4e90ab 100644
79+
index 9d72120..b2162ac 100644
8080
--- gcc-host-clean/libgcc/config.host
8181
+++ gcc-host-workdir/libgcc/config.host
8282
@@ -281,6 +281,11 @@ case ${host} in
8383
tmake_file="$tmake_file t-crtstuff-pic t-libgcc-pic t-eh-dw2-dip t-slibgcc t-slibgcc-fuchsia"
8484
extra_parts="crtbegin.o crtend.o"
8585
;;
86-
+*-*-vinix*)
87-
+ extra_parts="$extra_parts crti.o crtbegin.o crtbeginS.o crtend.o crtendS.o crtn.o"
86+
+*-*-*-mlibc)
87+
+ extra_parts="$extra_parts crtbegin.o crtbeginS.o crtend.o crtendS.o"
8888
+ tmake_file="$tmake_file t-crtstuff-pic"
8989
+ tmake_file="$tmake_file t-slibgcc t-slibgcc-gld t-slibgcc-elf-ver t-libgcc-pic"
9090
+ ;;
@@ -95,7 +95,7 @@ index 9d72120..b4e90ab 100644
9595
x86_64-*-fuchsia*)
9696
tmake_file="$tmake_file t-libgcc-pic"
9797
;;
98-
+x86_64-*-vinix*)
98+
+x86_64-*-*-mlibc)
9999
+ extra_parts="$extra_parts crtprec32.o crtprec64.o crtprec80.o crtfastmath.o"
100100
+ tmake_file="$tmake_file i386/t-crtpc t-crtfm i386/t-crtstuff t-dfprules"
101101
+ ;;
@@ -129,14 +129,14 @@ index 28d996f..61ff752 100644
129129
dnl Very limited version of automake's enable-maintainer-mode
130130

131131
diff --git gcc-host-clean/libstdc++-v3/crossconfig.m4 gcc-host-workdir/libstdc++-v3/crossconfig.m4
132-
index b3269cb..a1d4a28 100644
132+
index b3269cb..f2d4d13 100644
133133
--- gcc-host-clean/libstdc++-v3/crossconfig.m4
134134
+++ gcc-host-workdir/libstdc++-v3/crossconfig.m4
135135
@@ -136,6 +136,18 @@ case "${host}" in
136136
AC_CHECK_FUNCS(uselocale)
137137
;;
138138

139-
+ *-vinix*)
139+
+ *-mlibc*)
140140
+ GLIBCXX_CHECK_COMPILER_FEATURES
141141
+ GLIBCXX_CHECK_LINKER_FEATURES
142142
+ GLIBCXX_CHECK_MATH_SUPPORT

patches/libtool/jinx-working-patch.patch

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ index 0c40fed..763619b 100644
2525
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"
2626

2727
diff --git libtool-clean/m4/libtool.m4 libtool-workdir/m4/libtool.m4
28-
index 79a2451..b6e8ca4 100644
28+
index 79a2451..db95342 100644
2929
--- libtool-clean/m4/libtool.m4
3030
+++ libtool-workdir/m4/libtool.m4
3131
@@ -1696,7 +1696,7 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
@@ -41,7 +41,7 @@ index 79a2451..b6e8ca4 100644
4141
hardcode_into_libs=yes
4242
;;
4343

44-
+vinix*)
44+
+*-mlibc)
4545
+ version_type=linux # correct to gnu/linux during the next big refactor
4646
+ need_lib_prefix=no
4747
+ need_version=no
@@ -60,7 +60,7 @@ index 79a2451..b6e8ca4 100644
6060
lt_cv_deplibs_check_method=pass_all
6161
;;
6262

63-
+vinix*)
63+
+*-mlibc)
6464
+ lt_cv_deplibs_check_method=pass_all
6565
+ ;;
6666
+
@@ -71,7 +71,7 @@ index 79a2451..b6e8ca4 100644
7171
;;
7272
netbsd*)
7373
;;
74-
+ vinix*)
74+
+ *-mlibc)
7575
+ ;;
7676
*qnx* | *nto*)
7777
# QNX uses GNU C++, but need to define -shared option too, otherwise
@@ -80,7 +80,7 @@ index 79a2451..b6e8ca4 100644
8080
_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
8181
;;
8282

83-
+ vinix*)
83+
+ *-mlibc)
8484
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8585
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
8686
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
@@ -93,7 +93,7 @@ index 79a2451..b6e8ca4 100644
9393
fi
9494
;;
9595

96-
+ vinix*)
96+
+ *-mlibc)
9797
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
9898
+ _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'
9999
+ ;;
@@ -105,7 +105,7 @@ index 79a2451..b6e8ca4 100644
105105
esac
106106
;;
107107

108-
+ vinix*)
108+
+ *-mlibc)
109109
+ ;;
110110
+
111111
netbsd*)
@@ -115,24 +115,24 @@ index 79a2451..b6e8ca4 100644
115115
esac
116116
;;
117117

118-
+ vinix*)
118+
+ *-mlibc)
119119
+ _LT_TAGVAR(ld_shlibs, $1)=yes
120120
+ ;;
121121
+
122122
netbsd*)
123123
if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
124124
_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
125125
diff --git libtool-clean/m4/ltdl.m4 libtool-workdir/m4/ltdl.m4
126-
index 772c150..642966e 100644
126+
index 772c150..0ca254d 100644
127127
--- libtool-clean/m4/ltdl.m4
128128
+++ libtool-workdir/m4/ltdl.m4
129-
@@ -497,6 +497,9 @@ AC_CACHE_CHECK([whether deplibs are loaded by dlopen],
130-
# at 6.2 and later dlopen does load deplibs.
129+
@@ -481,6 +481,9 @@ AC_CACHE_CHECK([whether deplibs are loaded by dlopen],
130+
# GNU and its variants, using gnu ld.so (Glibc)
131131
lt_cv_sys_dlopen_deplibs=yes
132132
;;
133-
+ vinix*)
133+
+ *-mlibc)
134134
+ lt_cv_sys_dlopen_deplibs=yes
135135
+ ;;
136-
netbsd*)
136+
hpux10*|hpux11*)
137137
lt_cv_sys_dlopen_deplibs=yes
138138
;;

0 commit comments

Comments
 (0)