From 5a8f20c0ca54d9e82652a6521bfee0a847348f4c Mon Sep 17 00:00:00 2001 From: Bruce Mitchener Date: Tue, 12 Jan 2021 09:17:42 +0700 Subject: [PATCH] Default NOFORN to defined. (#209) The NOFORN flag controls foreign function interface code, which was written using the dld_* APIs which haven't existed in years. There was a GNU dld that provided this API, but it was withdrawn in 2006. If this code is to be re-enabled, it will have to be changed to use the `dlopen` family of APIs. --- CMakeLists.txt | 4 ---- bin/dosmkfil | 2 +- bin/makefile-cygwin.x86_64-x | 2 +- bin/makefile-darwin.386-x | 2 +- bin/makefile-darwin.aarch64-x | 2 +- bin/makefile-darwin.x86_64-x | 2 +- bin/makefile-dos | 2 +- bin/makefile-freebsd.386-x | 2 +- bin/makefile-init.386 | 2 +- bin/makefile-init.sparc-multi | 2 +- bin/makefile-linux.386-x | 2 +- bin/makefile-linux.armv7l-x | 2 +- bin/makefile-linux.x86_64-x | 2 +- bin/makefile-openbsd.x86_64-x | 2 +- bin/makefile.dos | 3 +-- bin/mkdos | 2 +- bin/mkfile | 2 +- bin/mkfile.c | 2 +- bin/mkfile.i | 2 +- inc/version.h | 7 +++++-- 20 files changed, 23 insertions(+), 25 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9ab4af2..84ab4dc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -59,23 +59,19 @@ ENDIF() IF(CMAKE_SYSTEM_NAME STREQUAL "Darwin") LIST(APPEND MAIKO_DEFINITIONS "-DMACOSX" - "-DNOFORN" ) ELSEIF(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD") LIST(APPEND MAIKO_DEFINITIONS "-DFREEBSD" - "-DNOFORN" ) ELSEIF(CMAKE_SYSTEM_NAME STREQUAL "OpenBSD") LIST(APPEND MAIKO_DEFINITIONS "-DOPENBSD" - "-DNOFORN" ) ELSEIF(CMAKE_SYSTEM_NAME STREQUAL "Linux") LIST(APPEND MAIKO_DEFINITIONS "-DAIX" # This is temporary "-DLINUX" - "-DNOFORN" ) ELSEIF(CMAKE_SYSTEM_NAME STREQUAL "SunOS") LIST(APPEND MAIKO_DEFINITIONS diff --git a/bin/dosmkfil b/bin/dosmkfil index 8ff219e..777f702 100644 --- a/bin/dosmkfil +++ b/bin/dosmkfil @@ -9,7 +9,7 @@ LPFILES = lpmain.obj lpread.obj lpsolve.obj lpwrite.obj lpdual.obj lptran.obj KEY = keytstno.obj CFLAGS = -DDOS -DBYTESWAP -DKBINT -DNOPIXRECT \ - -DNOFORN -DNOVERSION -DLPSOLVE -g + -DNOVERSION -DLPSOLVE -g LDFLAGS = -g graphics.lib binmode.lib mouse.lib diff --git a/bin/makefile-cygwin.x86_64-x b/bin/makefile-cygwin.x86_64-x index bfdbcd1..df9761f 100644 --- a/bin/makefile-cygwin.x86_64-x +++ b/bin/makefile-cygwin.x86_64-x @@ -23,7 +23,7 @@ OPTFLAGS = -O2 -g3 DISPOPTFLAGS = -O2 -g3 FPFLAGS = DFLAGS = -DLINUX -DAIX -DOLD_CURSOR \ - -DBYTESWAP -DFORKCOMM -DNOFORN -DLOGINT $(XFLAGS) \ + -DBYTESWAP -DFORKCOMM -DLOGINT $(XFLAGS) \ -DRELEASE=351 LDFLAGS = -L/usr/X11/lib -lX11 -lc -lm -lcrypt diff --git a/bin/makefile-darwin.386-x b/bin/makefile-darwin.386-x index 8bf7a9a..915ca35 100644 --- a/bin/makefile-darwin.386-x +++ b/bin/makefile-darwin.386-x @@ -22,7 +22,7 @@ DISPOPTFLAGS = -O2 -g FPFLAGS = DEBUGFLAGS = # -DDEBUG -DOPTRACE DFLAGS = $(DEBUGFLAGS) -DMACOSX -DOLD_CURSOR \ - -DBYTESWAP -DFORKCOMM -DNOFORN -DLOGINT $(XFLAGS) \ + -DBYTESWAP -DFORKCOMM -DLOGINT $(XFLAGS) \ -DRELEASE=351 -DSTACKCHECK -DFSBCHECK -DPCTRACE LDFLAGS = -L/opt/X11/lib -lX11 -lm diff --git a/bin/makefile-darwin.aarch64-x b/bin/makefile-darwin.aarch64-x index 4f99b72..c02418a 100644 --- a/bin/makefile-darwin.aarch64-x +++ b/bin/makefile-darwin.aarch64-x @@ -22,7 +22,7 @@ DISPOPTFLAGS = -O1 -g FPFLAGS = DEBUGFLAGS = # -DDEBUG -DOPTRACE DFLAGS = $(DEBUGFLAGS) -DMACOSX -DOLD_CURSOR \ - -DBYTESWAP -DFORKCOMM -DNOFORN -DLOGINT $(XFLAGS) \ + -DBYTESWAP -DFORKCOMM -DLOGINT $(XFLAGS) \ -DRELEASE=351 LDFLAGS = -L/opt/local/lib -lX11 -lm diff --git a/bin/makefile-darwin.x86_64-x b/bin/makefile-darwin.x86_64-x index 51bd37a..99aa279 100644 --- a/bin/makefile-darwin.x86_64-x +++ b/bin/makefile-darwin.x86_64-x @@ -22,7 +22,7 @@ DISPOPTFLAGS = -O1 -g FPFLAGS = DEBUGFLAGS = # -DDEBUG -DOPTRACE DFLAGS = $(DEBUGFLAGS) -DMACOSX -DOLD_CURSOR \ - -DBYTESWAP -DFORKCOMM -DNOFORN -DLOGINT $(XFLAGS) \ + -DBYTESWAP -DFORKCOMM -DLOGINT $(XFLAGS) \ -DRELEASE=351 LDFLAGS = -L/opt/X11/lib -lX11 -lm diff --git a/bin/makefile-dos b/bin/makefile-dos index 8ff219e..777f702 100644 --- a/bin/makefile-dos +++ b/bin/makefile-dos @@ -9,7 +9,7 @@ LPFILES = lpmain.obj lpread.obj lpsolve.obj lpwrite.obj lpdual.obj lptran.obj KEY = keytstno.obj CFLAGS = -DDOS -DBYTESWAP -DKBINT -DNOPIXRECT \ - -DNOFORN -DNOVERSION -DLPSOLVE -g + -DNOVERSION -DLPSOLVE -g LDFLAGS = -g graphics.lib binmode.lib mouse.lib diff --git a/bin/makefile-freebsd.386-x b/bin/makefile-freebsd.386-x index 1ddad3f..596e175 100644 --- a/bin/makefile-freebsd.386-x +++ b/bin/makefile-freebsd.386-x @@ -22,7 +22,7 @@ OPTFLAGS = -O1 -gdwarf-2 DISPOPTFLAGS = -O1 -gdwarf-2 FPFLAGS = DFLAGS = -DFREEBSD -DOLD_CURSOR \ - -DBYTESWAP -DFORKCOMM -DNOFORN -DLOGINT $(XFLAGS) \ + -DBYTESWAP -DFORKCOMM -DLOGINT $(XFLAGS) \ -DRELEASE=351 LDFLAGS = -L/usr/local/lib -lX11 -lc -lm -lcrypt diff --git a/bin/makefile-init.386 b/bin/makefile-init.386 index 6ddc840..ac0b222 100644 --- a/bin/makefile-init.386 +++ b/bin/makefile-init.386 @@ -21,7 +21,7 @@ OPTFLAGS = -O0 -g DISPOPTFLAGS = -O0 -g FPFLAGS = DFLAGS = -DMACOSX -DOLD_CURSOR \ - -DBYTESWAP -DFORKCOMM -DNOFORN -DLOGINT $(XFLAGS) \ + -DBYTESWAP -DFORKCOMM -DLOGINT $(XFLAGS) \ -DRELEASE=351 -DNOVERSION -DINIT -DTRACE -DOPTRACE LDFLAGS = -L/usr/X11/lib -lX11 -lm diff --git a/bin/makefile-init.sparc-multi b/bin/makefile-init.sparc-multi index 49760e6..26f4686 100644 --- a/bin/makefile-init.sparc-multi +++ b/bin/makefile-init.sparc-multi @@ -21,7 +21,7 @@ FPFLAGS = # for bigatom work, removed -DSPARCDISP -DSUN4_OS4_IL DFLAGS = -DINIT -DKBINT -DOS4 -DOS4_TYPE4BUG -DCOLOR \ -DNEWBITBLT -DLOGINT -DSUNDISPLAY -DDISPLAYBUFFER -DFORKCOMM \ - -DNOASM -DNOFORN -DRELEASE=210 # -DNOVERSION -DRELEASE=201 + -DNOASM -DRELEASE=210 # -DNOVERSION -DRELEASE=201 LDFLAGS = -lsuntool -lsunwindow -lpixrect -lc -lm #-Dsparc? diff --git a/bin/makefile-linux.386-x b/bin/makefile-linux.386-x index 6240b3a..6d2803f 100644 --- a/bin/makefile-linux.386-x +++ b/bin/makefile-linux.386-x @@ -22,7 +22,7 @@ OPTFLAGS = -O2 -g3 DISPOPTFLAGS = -O2 -g3 FPFLAGS = DFLAGS = -DLINUX -DAIX -DOLD_CURSOR \ - -DBYTESWAP -DFORKCOMM -DNOFORN -DLOGINT $(XFLAGS) \ + -DBYTESWAP -DFORKCOMM -DLOGINT $(XFLAGS) \ -DRELEASE=351 LDFLAGS = -L/usr/X11/lib -lX11 -lc -lm -lcrypt diff --git a/bin/makefile-linux.armv7l-x b/bin/makefile-linux.armv7l-x index 6d6732d..1d96302 100644 --- a/bin/makefile-linux.armv7l-x +++ b/bin/makefile-linux.armv7l-x @@ -22,7 +22,7 @@ OPTFLAGS = -O2 -g3 DISPOPTFLAGS = -O2 -g3 FPFLAGS = DFLAGS = -DLINUX -DAIX -DOLD_CURSOR \ - -DBYTESWAP -DFORKCOMM -DNOFORN -DLOGINT $(XFLAGS) \ + -DBYTESWAP -DFORKCOMM -DLOGINT $(XFLAGS) \ -DRELEASE=351 LDFLAGS = -L/usr/X11/lib -lX11 -lc -lm -lcrypt diff --git a/bin/makefile-linux.x86_64-x b/bin/makefile-linux.x86_64-x index bfdbcd1..df9761f 100644 --- a/bin/makefile-linux.x86_64-x +++ b/bin/makefile-linux.x86_64-x @@ -23,7 +23,7 @@ OPTFLAGS = -O2 -g3 DISPOPTFLAGS = -O2 -g3 FPFLAGS = DFLAGS = -DLINUX -DAIX -DOLD_CURSOR \ - -DBYTESWAP -DFORKCOMM -DNOFORN -DLOGINT $(XFLAGS) \ + -DBYTESWAP -DFORKCOMM -DLOGINT $(XFLAGS) \ -DRELEASE=351 LDFLAGS = -L/usr/X11/lib -lX11 -lc -lm -lcrypt diff --git a/bin/makefile-openbsd.x86_64-x b/bin/makefile-openbsd.x86_64-x index 46f1114..e3c6a33 100644 --- a/bin/makefile-openbsd.x86_64-x +++ b/bin/makefile-openbsd.x86_64-x @@ -22,7 +22,7 @@ OPTFLAGS = -O2 -g3 DISPOPTFLAGS = -O2 -g3 FPFLAGS = DFLAGS = -DOPENBSD -DAIX -DOLD_CURSOR \ - -DBYTESWAP -DFORKCOMM -DNOFORN -DLOGINT $(XFLAGS) \ + -DBYTESWAP -DFORKCOMM -DLOGINT $(XFLAGS) \ -DRELEASE=351 LDFLAGS = -L/usr/X11R6/lib -lX11 -lc -lm diff --git a/bin/makefile.dos b/bin/makefile.dos index 0ef60c8..2ec0dbc 100644 --- a/bin/makefile.dos +++ b/bin/makefile.dos @@ -8,8 +8,7 @@ LPFILES = lpmain.obj lpread.obj lpsolve.obj lpwrite.obj lpdual.obj lptran.obj KEY = keytstno.obj -CFLAGS = -DDOS -DBYTESWAP -DKBINT -DNOPIXRECT \ - -DNOFORN -DNOVERSION +CFLAGS = -DDOS -DBYTESWAP -DKBINT -DNOPIXRECT -DNOVERSION LDFLAGS = -g graphics.lib binmode.lib mouse.lib diff --git a/bin/mkdos b/bin/mkdos index 495481a..6d94ab3 100644 --- a/bin/mkdos +++ b/bin/mkdos @@ -25,7 +25,7 @@ # remember -DNOEUROKBD #ifdef _INTELC32_ /* The cpp macro for the DOS extender */ -#define EXTRACFLAGS -DDOS -DBYTESWAP -DKBINT -DNOPIXRECT -DNOFORN +#define EXTRACFLAGS -DDOS -DBYTESWAP -DKBINT -DNOPIXRECT #define EXTRALDFLAGS graphics.lib binmode.lib mouse.lib AFLAGS = /T COLORFILES = rawcolor.obj diff --git a/bin/mkfile b/bin/mkfile index b76c149..46c97ef 100644 --- a/bin/mkfile +++ b/bin/mkfile @@ -29,7 +29,7 @@ #define OBJECTDIR . #define BINDIR ../bin #define INCDIR ../inc -#define EXTRACFLAGS -DDOS -DBYTESWAP -DKBINT -DNOPIXRECT -DNOFORN +#define EXTRACFLAGS -DDOS -DBYTESWAP -DKBINT -DNOPIXRECT #define EXTRALDFLAGS graphics.lib binmode.lib mouse.lib BINARYDIR = BINDIR AFLAGS = /T diff --git a/bin/mkfile.c b/bin/mkfile.c index b76c149..46c97ef 100644 --- a/bin/mkfile.c +++ b/bin/mkfile.c @@ -29,7 +29,7 @@ #define OBJECTDIR . #define BINDIR ../bin #define INCDIR ../inc -#define EXTRACFLAGS -DDOS -DBYTESWAP -DKBINT -DNOPIXRECT -DNOFORN +#define EXTRACFLAGS -DDOS -DBYTESWAP -DKBINT -DNOPIXRECT #define EXTRALDFLAGS graphics.lib binmode.lib mouse.lib BINARYDIR = BINDIR AFLAGS = /T diff --git a/bin/mkfile.i b/bin/mkfile.i index 28ba646..089f9f1 100644 --- a/bin/mkfile.i +++ b/bin/mkfile.i @@ -24,7 +24,7 @@ ETHERFILES = ldeether.obj KEY = keytstno.obj -CFLAGS = -I. -DDOS -DBYTESWAP -DKBINT -DNOPIXRECT -DNOFORN -O2 +CFLAGS = -I. -DDOS -DBYTESWAP -DKBINT -DNOPIXRECT -O2 LDFLAGS = -O2 graphics.lib binmode.lib mouse.lib diff --git a/inc/version.h b/inc/version.h index f6fee5d..eb014e3 100644 --- a/inc/version.h +++ b/inc/version.h @@ -62,7 +62,6 @@ #define MINBVERSION 15000 #undef BIGATOMS #define NOEUROKBD -#define NOFORN #define NOVERSION #elif (RELEASE == 200) @@ -206,6 +205,11 @@ error Must specify RELEASE to build Medley. /* Set up defaults */ #define NOETHER 1 +/* Foreign function call support relies upon DLD which + * weren't supported in modern OSes and the GNU DLD + * library hasn't been supported or maintained since + * at least 2006. */ +#define NOFORN #define UNALIGNED_FETCH_OK #define HAS_GETHOSTID #define UNSIGNED unsigned long @@ -240,7 +244,6 @@ typedef signed char s_char; #ifdef OS5 /* Solaris, sort of SYSV-ish, but not really */ #undef NOETHER -#define NOFORN #define LOCK_X_UPDATES 1 #endif /* OS5 */