Fix build on armv7l due to Open File Descriptor Locks used in latest CVS

This commit is contained in:
Deon George 2019-08-28 15:28:32 +10:00
parent 31b240ba37
commit b69cf7851a
2 changed files with 32 additions and 2 deletions

View File

@ -26,9 +26,13 @@ RUN apt-get update \
&& apt-get clean \ && apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Workaround for Pi's
ADD fcntl-linux.h.patch /tmp
# Build SBBS # Build SBBS
RUN apt-get update \ RUN apt-get update \
&& apt-get install -yqq build-essential libnspr4-dev libncurses5-dev libmozjs185-dev cvs wget pkgconf \ && apt-get install -yqq build-essential libnspr4-dev libncurses5-dev libmozjs185-dev cvs wget pkgconf patch \
&& cd / && patch -p1 < /tmp/fcntl-linux.h.patch \
&& mkdir /opt/sbbs && cd /tmp \ && mkdir /opt/sbbs && cd /tmp \
&& wget http://cvs.synchro.net/cgi-bin/viewcvs.cgi/*checkout*/install/GNUmakefile \ && wget http://cvs.synchro.net/cgi-bin/viewcvs.cgi/*checkout*/install/GNUmakefile \
&& make RELEASE=1 USE_DOSEMU=1 NO_X=1 JSINCLUDE=/usr/include/js JSLIB=mozjs185 SBBSDIR=/opt/sbbs install \ && make RELEASE=1 USE_DOSEMU=1 NO_X=1 JSINCLUDE=/usr/include/js JSLIB=mozjs185 SBBSDIR=/opt/sbbs install \
@ -41,7 +45,7 @@ RUN apt-get update \
&& ln -sf nodes/node3 /opt/sbbs/ \ && ln -sf nodes/node3 /opt/sbbs/ \
&& ln -sf nodes/node4 /opt/sbbs/ \ && ln -sf nodes/node4 /opt/sbbs/ \
&& find /opt/sbbs -name CVS -type d -exec rm -rf {} + \ && find /opt/sbbs -name CVS -type d -exec rm -rf {} + \
&& apt-get -y purge build-essential libnspr4-dev libncurses5-dev libmozjs185-dev cvs wget pkgconf \ && apt-get -y purge build-essential libnspr4-dev libncurses5-dev libmozjs185-dev cvs wget pkgconf patch \
&& apt-get -y autoremove \ && apt-get -y autoremove \
&& apt-get clean \ && apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

26
fcntl-linux.h.patch Normal file
View File

@ -0,0 +1,26 @@
diff --git a/sysdeps/unix/sysv/linux/bits/fcntl-linux.h b/sysdeps/unix/sysv/linux/bits/fcntl-linux.h
index 7e5b0aecdcb4..5a4aad0698b8 100644
--- a/sysdeps/unix/sysv/linux/bits/fcntl-linux.h
+++ b/usr/include/arm-linux-gnueabihf/bits/fcntl-linux.h
@@ -127,11 +127,17 @@
This means that they are inherited across fork or clone with CLONE_FILES
like BSD (flock) locks, and they are only released automatically when the
last reference to the the file description against which they were acquired
- is put. */
+ is put.
+
+ Note that Linux does not support legacy (non-LFS) struct flock on 32-bit
+ arches with OFD locks. On those arches you need define both _GNU_SOURCE
+ and _FILE_OFFSET_BITS=64. */
#ifdef __USE_GNU
-# define F_OFD_GETLK 36
-# define F_OFD_SETLK 37
-# define F_OFD_SETLKW 38
+# if __OFF_T_MATCHES_OFF64_T || defined __USE_FILE_OFFSET64
+# define F_OFD_GETLK 36
+# define F_OFD_SETLK 37
+# define F_OFD_SETLKW 38
+# endif
#endif
#ifdef __USE_LARGEFILE64