From e1906837fc3bb1edf0612814941227100935739d Mon Sep 17 00:00:00 2001 From: Jerry James Date: Oct 28 2014 19:47:48 +0000 Subject: New upstream release. Drop upstreamed reloc patches. --- diff --git a/.gitignore b/.gitignore index 95782a7..99a7b6c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ /gcl-2.6.8-info.tar.xz -/gcl-2.6.11.tar.gz +/gcl-2.6.12.tar.gz diff --git a/gcl-2.6.11-aarch64.patch b/gcl-2.6.11-aarch64.patch deleted file mode 100644 index 1d3bc90..0000000 --- a/gcl-2.6.11-aarch64.patch +++ /dev/null @@ -1,15 +0,0 @@ ---- ./h/elf64_aarch64_reloc.h.orig 2014-09-06 09:45:30.000000000 -0600 -+++ ./h/elf64_aarch64_reloc.h 2014-10-10 12:30:00.000000000 -0600 -@@ -46,3 +46,12 @@ - case R_AARCH64_LDST128_ABS_LO12_NC: /* LD/ST128: (S+A) & 0xff0 */ - store_val(where,MASK(12) << 10,((s+a) & 0xff0) << 6); - break; -+ case R_AARCH64_PREL64: -+ store_val(where,~0L,(s+a-p)); -+ break; -+ case R_AARCH64_PREL32: -+ store_val(where,MASK(32),(s+a-p)); -+ break; -+ case R_AARCH64_PREL16: -+ store_val(where,MASK(16),(s+a-p)); -+ break; diff --git a/gcl-2.6.11-fd-leak.patch b/gcl-2.6.11-fd-leak.patch deleted file mode 100644 index 94ff4bb..0000000 --- a/gcl-2.6.11-fd-leak.patch +++ /dev/null @@ -1,17 +0,0 @@ ---- o/run_process.c.orig 2014-09-06 09:45:30.000000000 -0600 -+++ o/run_process.c 2014-09-06 20:00:00.000000000 -0600 -@@ -537,10 +537,10 @@ - fdout = ostream->sm.sm_int0; - if (fork() == 0) - { /* the child --- replace standard in and out with descriptors given */ -- close(0); -- massert(dup(fdin)>=0); -- close(1); -- massert(dup(fdout)>=0); -+ massert(dup2(fdin, 0)>=0); -+ massert(dup2(fdout, 1)>=0); -+ close(fdin); -+ close(fdout); - fprintf(stderr, "\n***** Spawning process %s ", pname); - if (execvp(pname, argv) == -1) - { diff --git a/gcl-2.6.11-largefile.patch b/gcl-2.6.11-largefile.patch deleted file mode 100644 index 2daec79..0000000 --- a/gcl-2.6.11-largefile.patch +++ /dev/null @@ -1,935 +0,0 @@ ---- ./configure.in.orig 2014-09-06 20:00:00.000000000 -0600 -+++ ./configure.in 2014-09-06 20:00:00.000000000 -0600 -@@ -472,7 +472,7 @@ AC_USE_SYSTEM_EXTENSIONS - AC_PROG_CC - AC_PROG_CPP - AC_SUBST(CC) -- -+AC_SYS_LARGEFILE - - # can only test for numbers -- CM - # if test "${GCC}" -eq "yes" ; then ---- ./configure.orig 2014-09-06 20:00:00.000000000 -0600 -+++ ./configure 2014-09-06 20:00:00.000000000 -0600 -@@ -769,6 +769,7 @@ enable_static - enable_pic - enable_oldgmp - enable_dynsysgmp -+enable_largefile - with_x - enable_readline - enable_ansi -@@ -1440,6 +1441,7 @@ debug safecdr code - - --enable-dynsysgmp will link against the system libgmp3 overriding certain functions with patched versions from the local source - -+ --disable-largefile omit support for large files - --enable-readline enables command line completion via the readline library - --enable-ansi builds a large gcl aiming for ansi compliance, - --disable-ansi builds the smaller traditional CLtL1 image -@@ -5157,6 +5159,205 @@ ac_link='$CC -o conftest$ac_exeext $CFLA - ac_compiler_gnu=$ac_cv_c_compiler_gnu - - -+# Check whether --enable-largefile was given. -+if test "${enable_largefile+set}" = set; then : -+ enableval=$enable_largefile; -+fi -+ -+if test "$enable_largefile" != no; then -+ -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5 -+$as_echo_n "checking for special C compiler options needed for large files... " >&6; } -+if ${ac_cv_sys_largefile_CC+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ ac_cv_sys_largefile_CC=no -+ if test "$GCC" != yes; then -+ ac_save_CC=$CC -+ while :; do -+ # IRIX 6.2 and later do not support large files by default, -+ # so use the C compiler's -n32 option if that helps. -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+#include -+ /* Check that off_t can represent 2**63 - 1 correctly. -+ We can't simply define LARGE_OFF_T to be 9223372036854775807, -+ since some C++ compilers masquerading as C compilers -+ incorrectly reject 9223372036854775807. */ -+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) -+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 -+ && LARGE_OFF_T % 2147483647 == 1) -+ ? 1 : -1]; -+int -+main () -+{ -+ -+ ; -+ return 0; -+} -+_ACEOF -+ if ac_fn_c_try_compile "$LINENO"; then : -+ break -+fi -+rm -f core conftest.err conftest.$ac_objext -+ CC="$CC -n32" -+ if ac_fn_c_try_compile "$LINENO"; then : -+ ac_cv_sys_largefile_CC=' -n32'; break -+fi -+rm -f core conftest.err conftest.$ac_objext -+ break -+ done -+ CC=$ac_save_CC -+ rm -f conftest.$ac_ext -+ fi -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5 -+$as_echo "$ac_cv_sys_largefile_CC" >&6; } -+ if test "$ac_cv_sys_largefile_CC" != no; then -+ CC=$CC$ac_cv_sys_largefile_CC -+ fi -+ -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5 -+$as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; } -+if ${ac_cv_sys_file_offset_bits+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ while :; do -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+#include -+ /* Check that off_t can represent 2**63 - 1 correctly. -+ We can't simply define LARGE_OFF_T to be 9223372036854775807, -+ since some C++ compilers masquerading as C compilers -+ incorrectly reject 9223372036854775807. */ -+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) -+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 -+ && LARGE_OFF_T % 2147483647 == 1) -+ ? 1 : -1]; -+int -+main () -+{ -+ -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_compile "$LINENO"; then : -+ ac_cv_sys_file_offset_bits=no; break -+fi -+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+#define _FILE_OFFSET_BITS 64 -+#include -+ /* Check that off_t can represent 2**63 - 1 correctly. -+ We can't simply define LARGE_OFF_T to be 9223372036854775807, -+ since some C++ compilers masquerading as C compilers -+ incorrectly reject 9223372036854775807. */ -+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) -+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 -+ && LARGE_OFF_T % 2147483647 == 1) -+ ? 1 : -1]; -+int -+main () -+{ -+ -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_compile "$LINENO"; then : -+ ac_cv_sys_file_offset_bits=64; break -+fi -+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -+ ac_cv_sys_file_offset_bits=unknown -+ break -+done -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5 -+$as_echo "$ac_cv_sys_file_offset_bits" >&6; } -+case $ac_cv_sys_file_offset_bits in #( -+ no | unknown) ;; -+ *) -+cat >>confdefs.h <<_ACEOF -+#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits -+_ACEOF -+;; -+esac -+rm -rf conftest* -+ if test $ac_cv_sys_file_offset_bits = unknown; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5 -+$as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; } -+if ${ac_cv_sys_large_files+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ while :; do -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+#include -+ /* Check that off_t can represent 2**63 - 1 correctly. -+ We can't simply define LARGE_OFF_T to be 9223372036854775807, -+ since some C++ compilers masquerading as C compilers -+ incorrectly reject 9223372036854775807. */ -+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) -+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 -+ && LARGE_OFF_T % 2147483647 == 1) -+ ? 1 : -1]; -+int -+main () -+{ -+ -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_compile "$LINENO"; then : -+ ac_cv_sys_large_files=no; break -+fi -+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+#define _LARGE_FILES 1 -+#include -+ /* Check that off_t can represent 2**63 - 1 correctly. -+ We can't simply define LARGE_OFF_T to be 9223372036854775807, -+ since some C++ compilers masquerading as C compilers -+ incorrectly reject 9223372036854775807. */ -+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) -+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 -+ && LARGE_OFF_T % 2147483647 == 1) -+ ? 1 : -1]; -+int -+main () -+{ -+ -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_compile "$LINENO"; then : -+ ac_cv_sys_large_files=1; break -+fi -+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -+ ac_cv_sys_large_files=unknown -+ break -+done -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5 -+$as_echo "$ac_cv_sys_large_files" >&6; } -+case $ac_cv_sys_large_files in #( -+ no | unknown) ;; -+ *) -+cat >>confdefs.h <<_ACEOF -+#define _LARGE_FILES $ac_cv_sys_large_files -+_ACEOF -+;; -+esac -+rm -rf conftest* -+ fi -+ -+ -+fi - - - # can only test for numbers -- CM ---- ./h/linux.h.orig 2014-09-06 09:45:30.000000000 -0600 -+++ ./h/linux.h 2014-09-06 20:00:00.000000000 -0600 -@@ -12,13 +12,13 @@ - #include - #define SEEK_TO_END_OFILE(fp)\ - do { \ -- long offset = 0, endofelf; int j; \ -+ off_t offset = 0, endofelf; int j; \ - ElfW(Ehdr) eheader; ElfW(Shdr) shdr; \ -- fseek(fp, 0, SEEK_SET); \ -+ fseeko(fp, 0, SEEK_SET); \ - massert(1==fread(&eheader, sizeof(eheader), 1, fp)); \ - /* in case the headers themselves come AFTER the actual sections */ \ - endofelf=offset = eheader.e_shoff+ eheader.e_shentsize *eheader.e_shnum;\ -- fseek(fp, eheader.e_shoff, SEEK_SET); \ -+ fseeko(fp, eheader.e_shoff, SEEK_SET); \ - if ( eheader.e_shentsize != sizeof(ElfW(Shdr)) ) \ - { FEerror("Bad ELF section header size",0); } \ - for ( j = 0; j < eheader.e_shnum; j++ ) \ -@@ -26,7 +26,7 @@ - if ( (shdr.sh_offset > offset) && (shdr.sh_type != SHT_NOBITS) ) \ - { offset = shdr.sh_offset; endofelf = offset+shdr.sh_size; } \ - } \ -- if ( fseek(fp, endofelf, SEEK_SET) ) \ -+ if ( fseeko(fp, endofelf, SEEK_SET) ) \ - FEerror("Bad ELF file",0); \ - } while(0) - ---- ./h/mp.h.orig 2014-09-06 09:45:30.000000000 -0600 -+++ ./h/mp.h 2014-09-06 20:00:00.000000000 -0600 -@@ -33,6 +33,22 @@ typedef struct - - #define SI_TO_MP(x, temp) (mpz_set_si(MP(temp),(x)), MP(temp)) - -+#define C_INT_TO_OBJ(x) ({ \ -+ object temp = big_fixnum1; \ -+ if (x >= MOST_NEGATIVE_FIX && x <= MOST_POSITIVE_FIX) \ -+ temp = make_fixnum(x); \ -+ else if (sizeof(x) <= sizeof(long)) \ -+ mpz_set_si(MP(big_fixnum1), x); \ -+ else if (x < 0) { \ -+ __typeof__(x) y = -x; \ -+ mpz_import(MP(big_fixnum2), 1U, 1, sizeof(x), 0, 0U, &y); \ -+ mpz_neg(MP(big_fixnum1), MP(big_fixnum2)); \ -+ } else { \ -+ __typeof__(x) y = x; \ -+ mpz_import(MP(big_fixnum1), 1U, 1, sizeof(x), 0, 0U, &y); \ -+ } \ -+ temp; \ -+}) - - #define INTEGER_TO_MP(x, temp ) \ - (type_of(x) == t_bignum ? MP(x) : SI_TO_MP(fix(x), temp)) -@@ -108,6 +124,20 @@ GEN subss(); - - #define SI_TO_MP(x,ignore) stoi(x) - -+#define C_INT_TO_OBJ(x) ({ \ -+ object temp = big_fixnum1; \ -+ if (x >= MOST_NEGATIVE_FIX && x <= MOST_POSITIVE_FIX) \ -+ temp = make_fixnum(x); \ -+ else if (sizeof(x) <= sizeof(long)) \ -+ MP(big_fixnum1) = stoi(x); \ -+ else if (x < 0) { \ -+ __typeof__(x) y = -x; \ -+ MP(big_fixnum1) = uutoineg((y) >> (sizeof(ulong) * 8), (y) & (ulong)-1); \ -+ } else \ -+ MP(big_fixnum1) = uutoi((x) >> (sizeof(ulong) * 8), (x) & (ulong)-1); \ -+ temp; \ -+}) -+ - #define INT_FLAG 0x1010000 - - #define MP_ALLOCATED(x) (x)->big.big_length ---- ./h/protoize.h.orig 2014-09-06 09:45:30.000000000 -0600 -+++ ./h/protoize.h 2014-09-06 20:00:00.000000000 -0600 -@@ -512,7 +512,7 @@ typedef void (*funcvoid)(void); - /* unixfsys.c:329:OF */ extern bool file_exists (object file); /* (file) object file; */ - /* unixfsys.c:359:OF */ extern FILE *backup_fopen (char *filename, char *option); /* (filename, option) char *filename; char *option; */ - /* unixfsys.c:359:OF */ extern FILE *fopen_not_dir (char *filename, char *option); /* (filename, option) char *filename; char *option; */ --/* unixfsys.c:372:OF */ extern int file_len (FILE *fp); /* (fp) FILE *fp; */ -+/* unixfsys.c:372:OF */ extern off_t file_len (FILE *fp); /* (fp) FILE *fp; */ - /* unixfsys.c:382:OF */ extern object truename (object); /* () */ - /* unixfsys.c:382:OF */ extern void Ltruename (void); /* () */ - /* unixfsys.c:418:OF */ extern object fSsetenv (object variable, object value); /* (variable, value) object variable; object value; */ -@@ -738,11 +738,11 @@ edit_double(int, double, int *, char *, - void - sethash(object,object,object); - --int -+off_t - file_position(object); - - int --file_position_set(object, int); -+file_position_set(object, off_t); - - void - princ_str(char *s, object); ---- ./o/fasdump.c.orig 2014-09-06 09:45:30.000000000 -0600 -+++ ./o/fasdump.c 2014-09-06 20:00:00.000000000 -0600 -@@ -23,6 +23,7 @@ - #ifndef FAT_STRING - #include "include.h" - #endif -+#include "num_include.h" - - static void - clrhash(object); -@@ -608,7 +609,7 @@ DEFUN_NEW("OPEN-FASD",object,fSopen_fasd - fd->eof=eof; - fd->index=small_fixnum(0); - fd->package=symbol_value(sLApackageA); -- fd->filepos = make_fixnum(file_position(stream)); -+ fd->filepos = C_INT_TO_OBJ(file_position(stream)); - - SETUP_FASD_IN(fd); - if (direction==sKoutput){ -@@ -649,7 +650,7 @@ DEFUN_NEW("CLOSE-FASD",object,fSclose_fa - {clrhash(fd->table); - SETUP_FASD_IN(fd); - PUT_OP(d_end_of_file); -- {int i = file_position(fd->stream); -+ {off_t i = file_position(fd->stream); - if(type_of(fd->filepos) == t_fixnum) - { file_position_set(fd->stream,fix(fd->filepos) +2); - /* record the length of array needed to read the indices */ ---- ./o/file.d.orig 2014-09-06 09:45:30.000000000 -0600 -+++ ./o/file.d 2014-09-06 20:00:00.000000000 -0600 -@@ -37,6 +37,7 @@ Foundation, 675 Mass Ave, Cambridge, MA - - #define IN_FILE - #include "include.h" -+#include "num_include.h" - - #ifdef HAVE_READLINE - #define kclgetc(FP) rl_getc_em(((FILE *)FP)) -@@ -394,7 +395,7 @@ object if_exists, if_does_not_exist; - FEerror("Cannot write pipe output to temporary file",0); - if (pclose(pp)<0) - FEerror("Cannot close zcat pipe",0); -- if (fseek(fp,0,SEEK_SET)) -+ if (fseeko(fp,0,SEEK_SET)) - FEerror("Cannot rewind temporary file\n",0); - goto AGAIN; - } -@@ -1313,7 +1314,7 @@ BEGIN: - } - } - --int -+off_t - file_position(strm) - object strm; - { -@@ -1325,7 +1326,7 @@ BEGIN: - /* return(strm->sm.sm_int0); */ - if (strm->sm.sm_fp == NULL) - closed_stream(strm); -- return(ftell(strm->sm.sm_fp)); -+ return(ftello(strm->sm.sm_fp)); - case smm_socket: - return -1; - -@@ -1356,7 +1357,7 @@ BEGIN: - int - file_position_set(strm, disp) - object strm; --int disp; -+off_t disp; - { - BEGIN: - switch (strm->sm.sm_mode) { -@@ -1366,7 +1367,7 @@ BEGIN: - case smm_output: - case smm_io: - -- if (fseek(strm->sm.sm_fp, disp, 0) < 0) -+ if (fseeko(strm->sm.sm_fp, disp, 0) < 0) - return(-1); - /* strm->sm.sm_int0 = disp; */ - return(0); -@@ -1402,7 +1403,7 @@ BEGIN: - } - } - --static int -+static off_t - file_length(strm) - object strm; - { -@@ -1768,14 +1769,14 @@ LFD(Lstream_element_type)() - @) - - @(defun file_position (file_stream &o position) -- int i=0; -+ off_t i=0; - @ - check_type_stream(&file_stream); - if (position == Cnil) { - i = file_position(file_stream); - if (i < 0) - @(return Cnil) -- @(return `make_fixnum(i)`) -+ @(return `C_INT_TO_OBJ(i)`) - } else { - if (position == sKstart) - i = 0; -@@ -1802,7 +1803,7 @@ LFD(Lfile_length)() - if (i < 0) - vs_base[0] = Cnil; - else -- vs_base[0] = make_fixnum(i); -+ vs_base[0] = C_INT_TO_OBJ(i); - } - - object sSAload_pathnameA; -@@ -2705,22 +2706,22 @@ read_fasl_data(const char *str) { - #ifdef BSD - fp = faslfile->sm.sm_fp; - fread(&header, sizeof(header), 1, fp); -- fseek(fp, -+ fseeko(fp, - header.a_text+header.a_data+ - header.a_syms+header.a_trsize+header.a_drsize, - 1); - fread(&i, sizeof(i), 1, fp); -- fseek(fp, i - sizeof(i), 1); -+ fseeko(fp, i - sizeof(i), 1); - #endif - - #ifdef HAVE_FILEHDR - fp = faslfile->sm.sm_fp; - fread(&fileheader, sizeof(fileheader), 1, fp); -- fseek(fp, -+ fseeko(fp, - fileheader.f_symptr+fileheader.f_nsyms*SYMESZ, - 0); - fread(&i, sizeof(i), 1, fp); -- fseek(fp, i - sizeof(i), 1); -+ fseeko(fp, i - sizeof(i), 1); - while ((i = getc(fp)) == 0) - ; - ungetc(i, fp); -@@ -2729,7 +2730,7 @@ read_fasl_data(const char *str) { - #ifdef E15 - fp = faslfile->sm.sm_fp; - fread(&header, sizeof(header), 1, fp); -- fseek(fp, -+ fseeko(fp, - header.a_text+header.a_data+ - header.a_syms+header.a_trsize+header.a_drsize, - 1); ---- ./o/sfasl.c.orig 2014-09-06 09:45:30.000000000 -0600 -+++ ./o/sfasl.c 2014-09-06 20:00:00.000000000 -0600 -@@ -148,7 +148,7 @@ void set_symbol_address ( struct syment - int - fasload(faslfile) - object faslfile; --{ long fasl_vector_start; -+{ off_t fasl_vector_start; - struct filehdr fileheader; - struct sfasl_info sfasl_info_buf; - #ifdef COFF -@@ -210,7 +210,7 @@ object faslfile; - symbol_table = - (struct syment *) OUR_ALLOCA(sizeof(struct syment)* - (unsigned int)nsyms); -- fseek(fp,(int)( N_SYMOFF(fileheader)), 0); -+ fseeko(fp,(off_t)( N_SYMOFF(fileheader)), 0); - { - for (i = 0; i < nsyms; i++) - { fread((char *)&symbol_table[i], SYMESZ, 1, fp); -@@ -221,7 +221,7 @@ object faslfile; - symbol_table[i].n_un.n_strx = string_size; - dprintf(string_size %d, string_size); - string_size += symbol_table[i].n_length + 1; -- fseek(fp,(int)symbol_table[i].n_length,1); -+ fseeko(fp,(off_t)symbol_table[i].n_length,1); - #endif - } - } -@@ -238,13 +238,13 @@ my_string_table=READ_IN_STRING_TABLE(fp, - - #else - #ifdef MUST_SEEK_TO_STROFF -- fseek(fp,N_STROFF(fileheader),0); -+ fseeko(fp,N_STROFF(fileheader),0); - #endif - {int ii=0; - if (!fread((char *)&ii,sizeof(int),1,fp)) - {FEerror("The string table of this file did not have any length",0, - 0);} -- fseek(fp,-4,1); -+ fseeko(fp,-4,1); - /* at present the string table is located just after the symbols */ - my_string_table=OUR_ALLOCA((unsigned int)ii); - dprintf( string table leng = %d, ii); -@@ -261,7 +261,7 @@ SEEK_TO_END_OFILE(fp); - ungetc(i, fp); - #endif - -- fasl_vector_start=ftell(fp); -+ fasl_vector_start=ftello(fp); - - if (!((c_table.ptable) && *(c_table.ptable))) - build_symbol_table(); -@@ -293,7 +293,7 @@ SEEK_TO_END_OFILE(fp); - #endif - - dprintf( code size %d , datasize+textsize+bsssize + extra_bss); -- if (fseek(fp,N_TXTOFF(fileheader) ,0) < 0) -+ if (fseeko(fp,N_TXTOFF(fileheader) ,0) < 0) - FEerror("file seek error",0,0); - SAFE_FREAD(the_start, textsize + datasize, 1, fp); - dprintf(read into memory text +data %d bytes, textsize + datasize); -@@ -307,7 +307,7 @@ SEEK_TO_END_OFILE(fp); - {int j=0; - for(j=1; j< BSS_NSCN ; j++) - { dprintf( relocating section %d \n,j); -- if (section[j].s_nreloc) fseek(fp,section[j].s_relptr,0); -+ if (section[j].s_nreloc) fseeko(fp,section[j].s_relptr,0); - for(i=0; i < section[j].s_nreloc; i++) - { struct syment *sym; - fread(&relocation_info, RELSZ, 1, fp); -@@ -326,7 +326,7 @@ SEEK_TO_END_OFILE(fp); - {int j=0; - for(j=1; j< BSS_NSCN ; j++) - { dprintf( relocating section %d \n,j); -- if (section[j].s_nreloc) fseek(fp,section[j].s_relptr,0); -+ if (section[j].s_nreloc) fseeko(fp,section[j].s_relptr,0); - #ifdef ADJUST_RELOC_START - ADJUST_RELOC_START(j) - #endif -@@ -338,7 +338,7 @@ ADJUST_RELOC_START(j) - }}; - #endif - #ifdef BSD -- fseek(fp,N_RELOFF(fileheader),0); -+ fseeko(fp,N_RELOFF(fileheader),0); - {int nrel = (fileheader.a_trsize/sizeof(struct reloc)); - for (i=0; i < nrel; i++) - {fread((char *)&relocation_info, sizeof(struct reloc), -@@ -348,7 +348,7 @@ ADJUST_RELOC_START(j) - } - } - #ifdef N_DRELOFF -- fseek (fp, N_DRELOFF(fileheader), 0); -+ fseeko (fp, N_DRELOFF(fileheader), 0); - #endif - {int nrel = (fileheader.a_drsize/sizeof(struct reloc)); - the_start += fileheader.a_text; -@@ -369,7 +369,7 @@ ADJUST_RELOC_START(j) - dprintf( datasize is %x,datasize); - - /* read in the fasl vector */ -- fseek(fp,fasl_vector_start,0); -+ fseeko(fp,fasl_vector_start,0); - if (feof(fp)) - {data=0;} - else{ ---- ./o/unexelf.c.orig 2014-09-06 09:45:30.000000000 -0600 -+++ ./o/unexelf.c 2014-09-06 20:00:00.000000000 -0600 -@@ -634,7 +634,8 @@ find_section (char *name, char *section_ - static void - unexec (char *new_name, char *old_name, unsigned int data_start, unsigned int bss_start, unsigned int entry_address) - { -- int new_file, old_file, new_file_size; -+ int new_file, old_file; -+ off_t new_file_size; - - /* Pointers to the base of the image of the two files. */ - caddr_t old_base, new_base; -@@ -664,7 +665,7 @@ unexec (char *new_name, char *old_name, - int old_data_index, new_data2_index; - int old_mdebug_index; - struct stat stat_buf; -- int old_file_size; -+ size_t old_file_size; - - /* Open the old file, allocate a buffer of the right size, and read - in the file contents. */ -@@ -687,7 +688,7 @@ unexec (char *new_name, char *old_name, - we'd dump our temporary buffers with Emacs, and we'd have to be - extra careful to use the correct value of sbrk(0) after - allocating all buffers in the code below, which we aren't. */ -- old_file_size = stat_buf.st_size; -+ old_file_size = (size_t) stat_buf.st_size; - old_base = mmap (NULL, old_file_size, PROT_READ,MAP_SHARED, old_file, 0); - if (old_base == MAP_FAILED) - fatal ("Can't allocate buffer for %s\n", old_name); -@@ -780,7 +781,7 @@ unexec (char *new_name, char *old_name, - if (ftruncate (new_file, new_file_size)) - fatal ("Can't ftruncate (%s): errno %d\n", new_name, errno); - -- new_base = mmap (NULL, new_file_size, PROT_READ | PROT_WRITE,MAP_SHARED, new_file, 0); -+ new_base = mmap (NULL, (size_t) new_file_size, PROT_READ | PROT_WRITE,MAP_SHARED, new_file, 0); - if (new_base == MAP_FAILED) - fatal ("Can't allocate buffer for %s\n", old_name); - -@@ -1216,7 +1217,7 @@ unexec (char *new_name, char *old_name, - /* new_file_size, new_base, errno); */ - - munmap (old_base, old_file_size); -- munmap (new_base, new_file_size); -+ munmap (new_base, (size_t) new_file_size); - - /* Close the files and make the new file executable. */ - ---- ./o/unixfasl.c.orig 2014-09-06 09:45:30.000000000 -0600 -+++ ./o/unixfasl.c 2014-09-06 20:00:00.000000000 -0600 -@@ -90,8 +90,8 @@ object faslfile; - #ifdef ATT - struct filehdr fileheader; - struct scnhdr sectionheader; -- int textsize, datasize, bsssize; -- int textstart; -+ off_t textsize, datasize, bsssize; -+ off_t textstart; - #endif - - #ifdef E15 -@@ -129,7 +129,7 @@ object faslfile; - #ifdef ATT - fread(&fileheader, sizeof(fileheader), 1, fp); - #ifdef S3000 -- if(fileheader.f_opthdr != 0) fseek(fp,fileheader.f_opthdr,1); -+ if(fileheader.f_opthdr != 0) fseeko(fp,fileheader.f_opthdr,1); - #endif - fread(§ionheader, sizeof(sectionheader), 1, fp); - textsize = sectionheader.s_size; -@@ -162,27 +162,27 @@ object faslfile; - SEEK_TO_END_OFILE(fp); - #else - #ifdef BSD -- fseek(fp, -+ fseeko(fp, - header.a_text+header.a_data+ - header.a_syms+header.a_trsize+header.a_drsize, - 1); - fread(&i, sizeof(i), 1, fp); -- fseek(fp, i - sizeof(i), 1); -+ fseeko(fp, i - sizeof(i), 1); - #endif - - #ifdef ATT -- fseek(fp, -+ fseeko(fp, - fileheader.f_symptr + SYMESZ*fileheader.f_nsyms, - 0); - fread(&i, sizeof(i), 1, fp); -- fseek(fp, i - sizeof(i), 1); -+ fseeko(fp, i - sizeof(i), 1); - while ((i = getc(fp)) == 0) - ; - ungetc(i, fp); - #endif - - #ifdef E15 -- fseek(fp, -+ fseeko(fp, - header.a_text+header.a_data+ - header.a_syms+header.a_trsize+header.a_drsize, - 1); -@@ -255,7 +255,7 @@ AGAIN: - } - #endif - -- if (fseek(fp, textstart, 0) < 0) -+ if (fseeko(fp, textstart, 0) < 0) - error("file seek error"); - - fread(memory->cfd.cfd_start, textsize + datasize, 1, fp); -@@ -334,12 +334,12 @@ SEEK_TO_END_OFILE(faslfile->sm.sm_fp); - #else - fp = faslfile->sm.sm_fp; - fread(&faslheader, sizeof(faslheader), 1, fp); -- fseek(fp, -+ fseeko(fp, - faslheader.a_text+faslheader.a_data+ - faslheader.a_syms+faslheader.a_trsize+faslheader.a_drsize, - 1); - fread(&i, sizeof(i), 1, fp); -- fseek(fp, i - sizeof(i), 1); -+ fseeko(fp, i - sizeof(i), 1); - #endif - data = read_fasl_vector(faslfile); - vs_push(data); -@@ -361,7 +361,7 @@ SEEK_TO_END_OFILE(faslfile->sm.sm_fp); - vs_push(tempfile); - fp = tempfile->sm.sm_fp; - -- if (fseek(fp, textstart, 0) < 0) -+ if (fseeko(fp, textstart, 0) < 0) - error("file seek error"); - - fread(memory->cfd.cfd_start, textsize + datasize, 1, fp); ---- ./o/unixfsys.c.orig 2014-09-06 20:00:00.000000000 -0600 -+++ ./o/unixfsys.c 2014-09-06 20:00:00.000000000 -0600 -@@ -26,6 +26,7 @@ Foundation, 675 Mass Ave, Cambridge, MA - - #define IN_UNIXFSYS - #include "include.h" -+#include "num_include.h" - #include - #include - #ifndef NO_PWD_H -@@ -414,7 +415,7 @@ backup_fopen(char *filename, char *optio - return(fopen(filename, option)); - } - --int -+off_t - file_len(FILE *fp) - { - struct stat filestatus; -@@ -523,7 +524,7 @@ DEFUN_NEW("STAT",object,fSstat,SI,1,1,NO - filename[j-1]=0;*/ - RETURN1(list(3,S_ISDIR(ss.st_mode) ? sKdirectory : - (S_ISLNK(ss.st_mode) ? sKlink : sKfile), -- make_fixnum(ss.st_size),make_fixnum(ss.st_ctime))); -+ C_INT_TO_OBJ(ss.st_size),make_fixnum(ss.st_ctime))); - } - } - ---- ./o/unixsave.c.orig 2014-09-06 09:45:30.000000000 -0600 -+++ ./o/unixsave.c 2014-09-06 20:00:00.000000000 -0600 -@@ -93,7 +93,7 @@ memory_save(original_file, save_file) - char *original_file, *save_file; - { MEM_SAVE_LOCALS; - char *data_begin, *data_end; -- int original_data; -+ off_t original_data = 0; - FILE *original, *save; - register int n; - register char *p; -@@ -130,7 +130,7 @@ char *original_file, *save_file; - } else - break; - -- fseek(original, original_data, 1); -+ fseeko(original, original_data, 1); - - COPY_TO_SAVE; - ---- ./unixport/bsd_rsym.c.orig 2014-09-06 09:45:30.000000000 -0600 -+++ ./unixport/bsd_rsym.c 2014-09-06 20:00:00.000000000 -0600 -@@ -121,7 +121,7 @@ tab.n_symbols=0;tab.tot_leng=0; - symout=fopen(outfile,"w"); - if (!symout) - {perror(outfile); exit(1);}; -- fseek(symout,sizeof(struct lsymbol_table),0); -+ fseeko(symout,sizeof(struct lsymbol_table),0); - end = my_symbol_table + NSYMS(my_header); - for (p = my_symbol_table; p < end; p++) { - /* -@@ -146,7 +146,7 @@ tab.n_symbols=0;tab.tot_leng=0; - dprintf( index , (int) (p - my_symbol_table) / sizeof(struct syment)); - p = p + NUM_AUX(p); } - } -- fseek(symout,0,0); -+ fseeko(symout,0,0); - fwrite(&tab,sizeof(tab),1,symout); - fclose(symout); - return 0; ---- ./unixport/rsym.c.orig 2014-09-06 09:45:30.000000000 -0600 -+++ ./unixport/rsym.c 2014-09-06 20:00:00.000000000 -0600 -@@ -102,7 +102,7 @@ char *filename; - sizeof(struct syment) and SYMESZ are not always the same. - */ - -- if(fseek(fp,(int)(N_SYMOFF(my_header)),0)) -+ if(fseeko(fp,(off_t)(N_SYMOFF(my_header)),0)) - {fprintf(stderr,"seek error"); - exit(1);} - -@@ -113,7 +113,7 @@ char *filename; - dprintf(string_size %d,string_size); - symbol_table[i].n_un.n_strx = string_size; - string_size += symbol_table[i].n_length + 1; -- fseek(fp,symbol_table[i].n_length,1); -+ fseeko(fp,symbol_table[i].n_length,1); - } - #else - fread((char *)&symbol_table[i], SYMESZ, 1, fp); -@@ -127,14 +127,14 @@ char *filename; - strings follow symbol table! */ - #ifndef HPUX - #ifdef N_STROFF -- fseek(fp,N_STROFF(my_header),0); -+ fseeko(fp,N_STROFF(my_header),0); - #endif - if (fread((char *)&string_size, 4, 1, fp) > 0) { - my_string_table = malloc(string_size); - if(debug) -- {printf(" string_size is %d fseek %d ",string_size,fseek(fp,string_size-1,1)); -- printf(" fseek back %d ",fseek(fp,1-string_size,1));}; -- fseek(fp, -4, 1); -+ {printf(" string_size is %d fseek %zd ",string_size,fseeko(fp,string_size-1,1)); -+ printf(" fseek back %d ",fseeko(fp,1-string_size,1));}; -+ fseeko(fp, -4, 1); - if(string_size!=(fread(my_string_table, 1, string_size, fp))) - {dprintf( string_size was %d ,string_size); - perror("rsym could not read bad string table") ; -@@ -149,10 +149,10 @@ char *filename; - int slen; - p = my_string_table=malloc((unsigned int)string_size); - dprintf( string table leng = %d, string_size); -- fseek(fp,(int)( LESYM_OFFSET(my_header)), 0); -+ fseeko(fp,(off_t)( LESYM_OFFSET(my_header)), 0); - for (i = 0; i < nsyms; i++) - { -- fseek(fp,SYMESZ, 1); -+ fseeko(fp,SYMESZ, 1); - slen = symbol_table[i].n_length; - dprintf( slen = %d,slen); - fread(p,slen,1,fp); -@@ -182,7 +182,7 @@ char *out; - symout=fopen(out,"wr"); - if (!symout) - {perror(out); exit(1);}; -- fseek(symout,sizeof(struct lsymbol_table),0); -+ fseeko(symout,sizeof(struct lsymbol_table),0); - end = symbol_table + nsyms; - for (p = symbol_table; p < end; p++) { - /* -@@ -219,7 +219,7 @@ char *out; - dprintf( index , (int) (p - symbol_table) / sizeof(struct syment)); - p = p + NUM_AUX(p); } - } -- fseek(symout,0,0); -+ fseeko(symout,0,0); - fwrite(&tab,sizeof(tab),1,symout); - fclose(symout); - #ifdef AIX3 -@@ -323,7 +323,7 @@ char *out; - symin=fopen(out,"w"); - if(symin==0) perror("can't open"); - fwrite(&tab,sizeof(tab),1,symin); -- fseek(symin,sizeof(tab),0); -+ fseeko(symin,sizeof(tab),0); - {int i,j; - unsigned short k; - for (i=0 ; i < tab.n_symbols ; i++) ---- ./unixport/rsym_elf.c.orig 2014-09-06 09:45:30.000000000 -0600 -+++ ./unixport/rsym_elf.c 2014-09-06 20:00:00.000000000 -0600 -@@ -147,7 +147,7 @@ get_section(fp,name) - else - shndx = get_section_number(name); - { -- fseek(fp,SECTION_H(shndx).sh_offset,SEEK_SET); -+ fseeko(fp,SECTION_H(shndx).sh_offset,SEEK_SET); - ans = malloc(SECTION_H(shndx).sh_size); - fread(ans,SECTION_H(shndx).sh_size,1,fp); - return ans; -@@ -173,7 +173,7 @@ char *filename; - } - - fread(&eheader,sizeof(eheader),1,fp); -- fseek(fp,eheader.e_ehsize,SEEK_SET); -+ fseeko(fp,eheader.e_ehsize,SEEK_SET); - fread(&pheader,sizeof(pheader),1,fp); - - if(ELFMAG0 != eheader.e_ident[0]){ -@@ -182,7 +182,7 @@ char *filename; - - section_headers = (void *)malloc(sizeof(ElfW(Shdr))* - (1+ eheader.e_shnum)); -- fseek(fp,eheader.e_shoff,0); -+ fseeko(fp,eheader.e_shoff,0); - for (i=0 ; i< eheader.e_shnum ; i++) - fread(§ion_headers[i],eheader.e_shentsize,1,fp); - -@@ -196,7 +196,7 @@ char *filename; - sizeof(struct syment) and SYMESZ are not always the same. - */ - -- if(fseek(fp,(int)SECTION_H(symbol_index).sh_offset,0)) -+ if(fseeko(fp,(off_t)SECTION_H(symbol_index).sh_offset,0)) - {fprintf(stderr,"seek error"); - exit(1);} - -@@ -242,7 +242,7 @@ char *out; - symout=fopen(out,"wr"); - if (!symout) - {perror(out); exit(1);}; -- fseek(symout,sizeof(struct lsymbol_table),0); -+ fseeko(symout,sizeof(struct lsymbol_table),0); - end = symbol_table + nsyms; - for (p = symbol_table; p < end; p++) { - /* -@@ -300,7 +300,7 @@ char *out; - dprintf( index , (int) (p - symbol_table) / sizeof(STRUCT_SYMENT)); - p = p + NUM_AUX(p); } - } -- fseek(symout,0,0); -+ fseeko(symout,0,0); - fwrite(&tab,sizeof(tab),1,symout); - fclose(symout); - #ifdef AIX3 diff --git a/gcl-2.6.11-ppc64.patch b/gcl-2.6.11-ppc64.patch deleted file mode 100644 index 8bdeda3..0000000 --- a/gcl-2.6.11-ppc64.patch +++ /dev/null @@ -1,18 +0,0 @@ ---- ./h/elf64_ppcle_reloc.h.orig 2014-09-06 09:45:30.000000000 -0600 -+++ ./h/elf64_ppcle_reloc.h 2014-09-28 20:00:00.000000000 -0600 -@@ -22,3 +22,6 @@ - case R_PPC64_TOC: - store_val(where,~0L,toc->st_value); - break; -+ case R_PPC64_REL32: -+ store_val(where,MASK(32),(s+a-p)); -+ break; ---- ./h/elf64_ppc_reloc.h.orig 2014-09-06 09:45:30.000000000 -0600 -+++ ./h/elf64_ppc_reloc.h 2014-09-28 20:00:00.000000000 -0600 -@@ -17,3 +17,6 @@ - case R_PPC64_TOC: - store_val(where,~0L,toc); - break; -+ case R_PPC64_REL32: -+ store_val(where,MASK(32)<<32,(s+a-p)<<32); -+ break; diff --git a/gcl-2.6.11-reloc-type.patch b/gcl-2.6.11-reloc-type.patch deleted file mode 100644 index 8092e4d..0000000 --- a/gcl-2.6.11-reloc-type.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- ./o/sfaslelf.c.orig 2014-09-06 09:45:30.000000000 -0600 -+++ ./o/sfaslelf.c 2014-09-06 20:00:00.000000000 -0600 -@@ -181,6 +181,7 @@ relocate(Sym *sym1,void *v,ul a,ul start - #include RELOC_H - - default: -+ fprintf(stderr, "Unknown reloc type %lu\n", tp); - massert(tp&~tp); - - } diff --git a/gcl-2.6.11-selinux.patch b/gcl-2.6.11-selinux.patch deleted file mode 100644 index e647214..0000000 --- a/gcl-2.6.11-selinux.patch +++ /dev/null @@ -1,257 +0,0 @@ -diff -durpN gcl-2.6.11.ORIG/clcs/makefile gcl-2.6.11/clcs/makefile ---- gcl-2.6.11.ORIG/clcs/makefile 2014-09-06 09:45:30.000000000 -0600 -+++ gcl-2.6.11/clcs/makefile 2014-09-06 20:00:00.000000000 -0600 -@@ -9,6 +9,7 @@ all: $(addsuffix .c,$(FILES)) $(addsuffi - - saved_clcs_gcl: ../unixport/saved_pcl_gcl$(EXE) - echo '(load "package.lisp")(load "myload.lisp")(si::save-system "$@")' | $< $(/dev/null 2>&1 ; then if grep -i oncrpc makedefs >/dev/null 2>&1 ; then cp /mingw/bin/oncrpc.dll $(DESTDIR)$(INSTALL_LIB_DIR)/$(PORTDIR); fi ; fi - cd $(DESTDIR)$(INSTALL_LIB_DIR)/$(PORTDIR) && \ - mv $(FLISP)$(EXE) temp$(EXE) && \ -+ ( chcon -t gcl_exec_t temp$(EXE) || true ) && \ - echo '(reset-sys-paths "$(INSTALL_LIB_DIR)/")(si::save-system "$(FLISP)$(EXE)")' | ./temp$(EXE) && \ - rm -f temp$(EXE) - if [ -e "unixport/rsym$(EXE)" ] ; then cp unixport/rsym$(EXE) $(DESTDIR)$(INSTALL_LIB_DIR)/unixport/ ; fi -diff -durpN gcl-2.6.11.ORIG/selinux/gcl.fc gcl-2.6.11/selinux/gcl.fc ---- gcl-2.6.11.ORIG/selinux/gcl.fc 1969-12-31 17:00:00.000000000 -0700 -+++ gcl-2.6.11/selinux/gcl.fc 2010-12-29 11:46:30.625141327 -0700 -@@ -0,0 +1,5 @@ -+/usr/lib64/gcl-[^/]+/unixport/saved_.* -- gen_context(system_u:object_r:gcl_exec_t,s0) -+/usr/lib/gcl-[^/]+/unixport/saved_.* -- gen_context(system_u:object_r:gcl_exec_t,s0) -+/usr/lib/maxima/[^/]+/binary-gcl/maxima -- gen_context(system_u:object_r:gcl_exec_t,s0) -+/usr/lib64/maxima/[^/]+/binary-gcl/maxima -- gen_context(system_u:object_r:gcl_exec_t,s0) -+ -diff -durpN gcl-2.6.11.ORIG/selinux/gcl.if gcl-2.6.11/selinux/gcl.if ---- gcl-2.6.11.ORIG/selinux/gcl.if 1969-12-31 17:00:00.000000000 -0700 -+++ gcl-2.6.11/selinux/gcl.if 2010-12-29 11:46:30.626141206 -0700 -@@ -0,0 +1,146 @@ -+ -+## policy for gcl -+ -+######################################## -+## -+## Execute a domain transition to run gcl. -+## -+## -+## -+## Domain allowed to transition. -+## -+## -+# -+interface(`gcl_domtrans',` -+ gen_require(` -+ type gcl_t; -+ type gcl_exec_t; -+ ') -+ -+ domtrans_pattern($1,gcl_exec_t,gcl_t) -+') -+ -+ -+######################################## -+## -+## Do not audit attempts to read, -+## gcl tmp files -+## -+## -+## -+## Domain to not audit. -+## -+## -+# -+interface(`gcl_dontaudit_read_tmp_files',` -+ gen_require(` -+ type gcl_tmp_t; -+ ') -+ -+ dontaudit $1 gcl_tmp_t:file read_file_perms; -+') -+ -+######################################## -+## -+## Allow domain to read, gcl tmp files -+## -+## -+## -+## Domain to not audit. -+## -+## -+# -+interface(`gcl_read_tmp_files',` -+ gen_require(` -+ type gcl_tmp_t; -+ ') -+ -+ allow $1 gcl_tmp_t:file read_file_perms; -+') -+ -+######################################## -+## -+## Allow domain to manage gcl tmp files -+## -+## -+## -+## Domain to not audit. -+## -+## -+# -+interface(`gcl_manage_tmp',` -+ gen_require(` -+ type gcl_tmp_t; -+ ') -+ -+ manage_dirs_pattern($1,gcl_tmp_t,gcl_tmp_t) -+ manage_files_pattern($1,gcl_tmp_t,gcl_tmp_t) -+ manage_lnk_files_pattern($1,gcl_tmp_t,gcl_tmp_t) -+') -+ -+######################################## -+## -+## Execute gcl in the gcl domain, and -+## allow the specified role the gcl domain. -+## -+## -+## -+## Domain allowed access -+## -+## -+## -+## -+## The role to be allowed the gcl domain. -+## -+## -+## -+## -+## The type of the role's terminal. -+## -+## -+# -+interface(`gcl_run',` -+ gen_require(` -+ type gcl_t; -+ ') -+ -+ gcl_domtrans($1) -+ role $2 types gcl_t; -+ dontaudit gcl_t $3:chr_file rw_term_perms; -+') -+ -+ -+######################################## -+## -+## All of the rules required to administrate -+## an gcl environment -+## -+## -+## -+## Domain allowed access. -+## -+## -+## -+## -+## The role to be allowed to manage the gcl domain. -+## -+## -+## -+## -+## The type of the user terminal. -+## -+## -+## -+# -+interface(`gcl_admin',` -+ gen_require(` -+ type gcl_t; -+ ') -+ -+ allow $1 gcl_t:process { ptrace signal_perms getattr }; -+ read_files_pattern($1, gcl_t, gcl_t) -+ -+ -+ gcl_manage_tmp($1) -+ -+') -diff -durpN gcl-2.6.11.ORIG/selinux/gcl.te gcl-2.6.11/selinux/gcl.te ---- gcl-2.6.11.ORIG/selinux/gcl.te 1969-12-31 17:00:00.000000000 -0700 -+++ gcl-2.6.11/selinux/gcl.te 2010-12-29 11:46:30.627141086 -0700 -@@ -0,0 +1,45 @@ -+policy_module(gcl,1.0.1) -+ -+######################################## -+# -+# Declarations -+# -+ -+type gcl_t; -+type gcl_exec_t; -+application_domain(gcl_t, gcl_exec_t) -+role system_r types gcl_t; -+ -+######################################## -+# -+# gcl local policy -+# -+ -+## internal communication is often done using fifo and unix sockets. -+allow gcl_t self:fifo_file rw_file_perms; -+allow gcl_t self:unix_stream_socket create_stream_socket_perms; -+ -+libs_use_ld_so(gcl_t) -+libs_use_shared_libs(gcl_t) -+ -+miscfiles_read_localization(gcl_t) -+ -+## The GCL memory management and executable dumping routines manipulate memory -+## in various (usually forbidden) ways. -+allow gcl_t self:process { execmem execheap }; -+ -+optional_policy(` -+ unconfined_domain(gcl_t) -+') -+ -+optional_policy(` -+ gen_require(` -+ type unconfined_t; -+ type unconfined_devpts_t; -+ type unconfined_tty_device_t; -+ role unconfined_r; -+ ') -+ -+ gcl_run(unconfined_t, unconfined_r, { unconfined_tty_device_t unconfined_devpts_t }) -+ allow gcl_t gcl_exec_t:file execmod; -+') -diff -durpN gcl-2.6.11.ORIG/unixport/makefile gcl-2.6.11/unixport/makefile ---- gcl-2.6.11.ORIG/unixport/makefile 2014-09-06 09:45:30.000000000 -0600 -+++ gcl-2.6.11/unixport/makefile 2014-09-06 20:00:00.000000000 -0600 -@@ -128,6 +128,7 @@ saved_%:raw_% $(RSYM) init_%.lsp raw_%_m - echo " (in-package \"USER\")(system:save-system \"$@\")" >>foo - ar x lib$*.a $$(ar t lib$*.a |grep ^gcl_) - $(PORTDIR)/raw_$*$(EXE) $(PORTDIR)/ -libdir $(GCLDIR)/ < foo -+ chcon -t gcl_exec_t $@ || true - # check that saved image can be prelinked - [ "$(PRELINK_CHECK)" = "" ] || \ - ! [ -x /usr/bin/objdump ] || \ -@@ -174,6 +175,7 @@ ifeq ($(GNU_LD),1) - else - $(CC) $(LD_FLAGS) -o raw_$*$(EXE) $(filter %.o,$^) -L. $(EXTRA_LD_LIBS) $(LD_LIBS_PRE) -l$* $(LD_LIBS_POST) - endif -+ chcon -t gcl_exec_t raw_$*$(EXE) || true - # diff map_$* map_$*.old >/dev/null || (cp map_$* map_$*.old && rm -f $@ && $(MAKE) $@) - # cp map_$*.old map_$* - diff --git a/gcl-2.6.11-unrandomize.patch b/gcl-2.6.11-unrandomize.patch deleted file mode 100644 index b4a49a2..0000000 --- a/gcl-2.6.11-unrandomize.patch +++ /dev/null @@ -1,421 +0,0 @@ ---- ./configure.in.orig 2014-09-06 20:00:00.000000000 -0600 -+++ ./configure.in 2014-09-06 20:00:00.000000000 -0600 -@@ -1435,9 +1435,11 @@ if test "$HAVE_SBRK" = "1" ; then - AC_LANG_SOURCE([[ - #include - #include -+ #define CAN_UNRANDOMIZE_SBRK 1 -+ #include "h/unrandomize.h" - void gprof_cleanup() {} - int main(int argc,char **argv,char **envp) { -- #include "h/unrandomize.h" -+ UNRANDOMIZE_SBRK; - return 0;}]])], - [AC_MSG_RESULT(yes) - AC_DEFINE(CAN_UNRANDOMIZE_SBRK,1,[can prevent sbrk from returning random values])], -@@ -1447,12 +1449,11 @@ if test "$HAVE_SBRK" = "1" ; then - AC_RUN_IFELSE([AC_LANG_SOURCE([[ - #include - #include -+ #include "h/unrandomize.h" - void gprof_cleanup() {} - int main(int argc,char * argv[],char * envp[]) { - FILE *f; -- #ifdef CAN_UNRANDOMIZE_SBRK -- #include "h/unrandomize.h" -- #endif -+ UNRANDOMIZE_SBRK; - if (!(f=fopen("conftest1","w"))) return -1; - fprintf(f,"%u",sbrk(0)); - return 0;}]])],SBRK=`cat conftest1`,SBRK=0,SBRK=0) -@@ -1462,12 +1463,11 @@ if test "$HAVE_SBRK" = "1" ; then - AC_RUN_IFELSE([AC_LANG_SOURCE([[ - #include - #include -+ #include "h/unrandomize.h" - void gprof_cleanup() {} - int main(int argc,char * argv[],char * envp[]) { - FILE *f; -- #ifdef CAN_UNRANDOMIZE_SBRK -- #include "h/unrandomize.h" -- #endif -+ UNRANDOMIZE_SBRK; - if (!(f=fopen("conftest1","w"))) return -1; - fprintf(f,"%u",sbrk(0)); - return 0;}]])],SBRK1=`cat conftest1`,SBRK1=0,SBRK1=0) -@@ -1539,6 +1539,7 @@ AC_MSG_CHECKING(CSTACK_ADDRESS) - AC_RUN_IFELSE([AC_LANG_SOURCE([[ - #include - #include -+ #include "h/unrandomize.h" - void * - foo() { - int i; -@@ -1551,9 +1552,7 @@ AC_RUN_IFELSE([AC_LANG_SOURCE([[ - FILE *fp = fopen("conftest1","w"); - unsigned long i,j; - -- #ifdef CAN_UNRANDOMIZE_SBRK -- #include "h/unrandomize.h" -- #endif -+ UNRANDOMIZE_SBRK; - j=1; - j<<=$PAGEWIDTH; - j<<=16; -@@ -1573,6 +1572,7 @@ AC_MSG_CHECKING([cstack bits]) - AC_RUN_IFELSE([AC_LANG_SOURCE([[ - #include - #include -+ #include "h/unrandomize.h" - void * - foo() { - int i; -@@ -1585,9 +1585,7 @@ AC_RUN_IFELSE([AC_LANG_SOURCE([[ - FILE *fp = fopen("conftest1","w"); - unsigned long i,j; - -- #ifdef CAN_UNRANDOMIZE_SBRK -- #include "h/unrandomize.h" -- #endif -+ UNRANDOMIZE_SBRK; - j=1; - j<<=$PAGEWIDTH; - j<<=16; -@@ -1608,11 +1606,10 @@ AC_MSG_CHECKING(NEG_CSTACK_ADDRESS) - AC_RUN_IFELSE([AC_LANG_SOURCE([[ - #include - #include -+ #include "h/unrandomize.h" - void gprof_cleanup() {} - int main(int argc,char **argv,char **envp) { -- #ifdef CAN_UNRANDOMIZE_SBRK -- #include "h/unrandomize.h" -- #endif -+ UNRANDOMIZE_SBRK; - return (long)$cstack_address<0 ? 0 : -1; - }]])],[AC_MSG_RESULT(yes) - neg_cstack_address=1 -@@ -1625,14 +1622,13 @@ AC_MSG_CHECKING([finding CSTACK_ALIGNMEN - AC_RUN_IFELSE([AC_LANG_SOURCE([[ - #include - #include -+ #include "h/unrandomize.h" - void gprof_cleanup() {} - int main(int argc,char **argv,char **envp) { - void *b,*c; - FILE *fp = fopen("conftest1","w"); - long n; -- #ifdef CAN_UNRANDOMIZE_SBRK -- #include "h/unrandomize.h" -- #endif -+ UNRANDOMIZE_SBRK; - b=alloca(sizeof(b)); - c=alloca(sizeof(c)); - n=b>c ? b-c : c-b; -@@ -1648,6 +1644,7 @@ AC_MSG_CHECKING(CSTACK_DIRECTION) - AC_RUN_IFELSE([AC_LANG_SOURCE([[ - #include - #include -+ #include "h/unrandomize.h" - void * - foo(void) { - int i; -@@ -1658,9 +1655,7 @@ AC_RUN_IFELSE([AC_LANG_SOURCE([[ - int main(int argc,char **argv,char **envp) { - char *b; - FILE *fp = fopen("conftest1","w"); -- #ifdef CAN_UNRANDOMIZE_SBRK -- #include "h/unrandomize.h" -- #endif -+ UNRANDOMIZE_SBRK; - fprintf(fp,"%d",((long) &b) > ((long) foo()) ? -1 : 1); - fclose(fp); - return 0; ---- ./configure.orig 2014-09-06 20:00:00.000000000 -0600 -+++ ./configure 2014-09-06 20:00:00.000000000 -0600 -@@ -7695,9 +7695,11 @@ else - - #include - #include -+ #define CAN_UNRANDOMIZE_SBRK 1 -+ #include "h/unrandomize.h" - void gprof_cleanup() {} - int main(int argc,char **argv,char **envp) { -- #include "h/unrandomize.h" -+ UNRANDOMIZE_SBRK; - return 0;} - _ACEOF - if ac_fn_c_try_run "$LINENO"; then : -@@ -7725,12 +7727,11 @@ else - - #include - #include -+ #include "h/unrandomize.h" - void gprof_cleanup() {} - int main(int argc,char * argv[],char * envp[]) { - FILE *f; -- #ifdef CAN_UNRANDOMIZE_SBRK -- #include "h/unrandomize.h" -- #endif -+ UNRANDOMIZE_SBRK; - if (!(f=fopen("conftest1","w"))) return -1; - fprintf(f,"%u",sbrk(0)); - return 0;} -@@ -7755,12 +7756,11 @@ else - - #include - #include -+ #include "h/unrandomize.h" - void gprof_cleanup() {} - int main(int argc,char * argv[],char * envp[]) { - FILE *f; -- #ifdef CAN_UNRANDOMIZE_SBRK -- #include "h/unrandomize.h" -- #endif -+ UNRANDOMIZE_SBRK; - if (!(f=fopen("conftest1","w"))) return -1; - fprintf(f,"%u",sbrk(0)); - return 0;} -@@ -7814,6 +7814,7 @@ else - - #include - #include -+ #include "h/unrandomize.h" - void * - foo() { - int i; -@@ -7826,9 +7827,7 @@ else - FILE *fp = fopen("conftest1","w"); - unsigned long i,j; - -- #ifdef CAN_UNRANDOMIZE_SBRK -- #include "h/unrandomize.h" -- #endif -+ UNRANDOMIZE_SBRK; - j=1; - j<<=$PAGEWIDTH; - j<<=16; -@@ -7872,6 +7871,7 @@ else - - #include - #include -+ #include "h/unrandomize.h" - void * - foo() { - int i; -@@ -7884,9 +7884,7 @@ else - FILE *fp = fopen("conftest1","w"); - unsigned long i,j; - -- #ifdef CAN_UNRANDOMIZE_SBRK -- #include "h/unrandomize.h" -- #endif -+ UNRANDOMIZE_SBRK; - j=1; - j<<=$PAGEWIDTH; - j<<=16; -@@ -7931,11 +7929,10 @@ else - - #include - #include -+ #include "h/unrandomize.h" - void gprof_cleanup() {} - int main(int argc,char **argv,char **envp) { -- #ifdef CAN_UNRANDOMIZE_SBRK -- #include "h/unrandomize.h" -- #endif -+ UNRANDOMIZE_SBRK; - return (long)$cstack_address<0 ? 0 : -1; - } - _ACEOF -@@ -7970,14 +7967,13 @@ else - - #include - #include -+ #include "h/unrandomize.h" - void gprof_cleanup() {} - int main(int argc,char **argv,char **envp) { - void *b,*c; - FILE *fp = fopen("conftest1","w"); - long n; -- #ifdef CAN_UNRANDOMIZE_SBRK -- #include "h/unrandomize.h" -- #endif -+ UNRANDOMIZE_SBRK; - b=alloca(sizeof(b)); - c=alloca(sizeof(c)); - n=b>c ? b-c : c-b; -@@ -8017,6 +8013,7 @@ else - - #include - #include -+ #include "h/unrandomize.h" - void * - foo(void) { - int i; -@@ -8027,9 +8024,7 @@ else - int main(int argc,char **argv,char **envp) { - char *b; - FILE *fp = fopen("conftest1","w"); -- #ifdef CAN_UNRANDOMIZE_SBRK -- #include "h/unrandomize.h" -- #endif -+ UNRANDOMIZE_SBRK; - fprintf(fp,"%d",((long) &b) > ((long) foo()) ? -1 : 1); - fclose(fp); - return 0; ---- ./h/unrandomize.h.orig 2014-09-06 09:45:30.000000000 -0600 -+++ ./h/unrandomize.h 2014-09-06 20:00:00.000000000 -0600 -@@ -1,3 +1,5 @@ -+#include -+#include - #include - #include - #include -@@ -5,61 +7,66 @@ - #include - #include - --{ -- errno=0; -- -- { -- -- /*READ_IMPLIES_EXEC is for selinux, but selinux will reset it in the child*/ -- long pers = personality(READ_IMPLIES_EXEC|personality(0xffffffffUL)); -- long flag = ADDR_NO_RANDOMIZE; -- -- if (sizeof(long)==4) flag|=ADDR_LIMIT_3GB|ADDR_COMPAT_LAYOUT; -- -- if (pers==-1) {printf("personality failure %d\n",errno);exit(-1);} -- if ((pers & flag)!=flag && !getenv("GCL_UNRANDOMIZE")) { -- errno=0; -- if (personality(pers | flag) != -1 && (personality(0xffffffffUL) & flag)==flag) { -- int i,j,k; -- char **n,**a; -- void *v; -- for (i=j=0;argv[i];i++) -- j+=strlen(argv[i])+1; -- for (k=0;envp[k];k++) -- j+=strlen(envp[k])+1; -- j+=(i+k+3)*sizeof(char *); -- if ((v=sbrk(j))==(void *)-1) { -- printf("Cannot brk environment space\n"); -- exit(-1); -- } -- a=v; -- v=a+i+1; -- n=v; -- v=n+k+2; -- for (i=0;argv[i];i++) { -- a[i]=v; -- strcpy(v,argv[i]); -- v+=strlen(v)+1; -- } -- a[i]=0; -- for (k=0;envp[k];k++) { -- n[k]=v; -- strcpy(v,envp[k]); -- v+=strlen(v)+1; -- } -- n[k]="GCL_UNRANDOMIZE=t"; -- n[k+1]=0; --#ifdef GCL_GPROF -- gprof_cleanup(); -+#ifdef CAN_UNRANDOMIZE_SBRK -+# ifdef GCL_GPROF -+# define GPROF_CLEANUP gprof_cleanup() -+# else -+# define GPROF_CLEANUP -+# endif -+# define UNRANDOMIZE_SBRK do { \ -+ errno=0; \ -+ { \ -+ /*READ_IMPLIES_EXEC is for selinux, but selinux will reset it in the child*/ \ -+ long pers = personality(0xffffffffUL); \ -+ long flag = ADDR_NO_RANDOMIZE; \ -+ \ -+ if (sizeof(long)==4) flag|=ADDR_LIMIT_3GB|ADDR_COMPAT_LAYOUT; \ -+ \ -+ if (pers==-1) {printf("personality failure %d\n",errno);exit(-1);} \ -+ if ((pers & flag)!=flag && !getenv("GCL_UNRANDOMIZE")) { \ -+ errno=0; \ -+ if (personality(pers | flag) != -1 && (personality(0xffffffffUL) & flag)==flag) { \ -+ int i,j,k; \ -+ char **n,**a; \ -+ void *v; \ -+ for (i=j=0;argv[i];i++) \ -+ j+=strlen(argv[i])+1; \ -+ for (k=0;envp[k];k++) \ -+ j+=strlen(envp[k])+1; \ -+ j+=(i+k+3)*sizeof(char *); \ -+ if ((v=sbrk(j))==(void *)-1) { \ -+ printf("Cannot brk environment space\n"); \ -+ exit(-1); \ -+ } \ -+ a=v; \ -+ v=a+i+1; \ -+ n=v; \ -+ v=n+k+2; \ -+ for (i=0;argv[i];i++) { \ -+ a[i]=v; \ -+ strcpy(v,argv[i]); \ -+ v+=strlen(v)+1; \ -+ } \ -+ a[i]=0; \ -+ for (k=0;envp[k];k++) { \ -+ n[k]=v; \ -+ strcpy(v,envp[k]); \ -+ v+=strlen(v)+1; \ -+ } \ -+ n[k]="GCL_UNRANDOMIZE=t"; \ -+ n[k+1]=0; \ -+ GPROF_CLEANUP; \ -+ errno=0; \ -+ execve(*a,a,n); \ -+ printf("execve failure %d\n",errno); \ -+ exit(-1); \ -+ } else { \ -+ printf("personality change failure %d\n",errno); \ -+ exit(-1); \ -+ } \ -+ } \ -+ } \ -+} while (0) -+#else -+# define UNRANDOMIZE_SBRK - #endif -- errno=0; -- execve(*a,a,n); -- printf("execve failure %d\n",errno); -- exit(-1); -- } else { -- printf("personality change failure %d\n",errno); -- exit(-1); -- } -- } -- } --} ---- ./o/main.c.orig 2014-09-06 09:45:30.000000000 -0600 -+++ ./o/main.c 2014-09-06 20:00:00.000000000 -0600 -@@ -50,6 +50,7 @@ void initialize_process(); - #include "include.h" - #include - #include "page.h" -+#include "unrandomize.h" - - bool saving_system=FALSE; - -@@ -357,11 +358,7 @@ main(int argc, char **argv, char **envp) - - gcl_init_alloc(&argv); - --#ifdef CAN_UNRANDOMIZE_SBRK --#include --#include --#include "unrandomize.h" --#endif -+ UNRANDOMIZE_SBRK; - - #ifdef LD_BIND_NOW - #include diff --git a/gcl-2.6.12-fd-leak.patch b/gcl-2.6.12-fd-leak.patch new file mode 100644 index 0000000..9f1e31f --- /dev/null +++ b/gcl-2.6.12-fd-leak.patch @@ -0,0 +1,17 @@ +--- o/run_process.c.orig 2014-10-23 15:29:00.000000000 -0600 ++++ o/run_process.c 2014-10-28 12:00:00.000000000 -0600 +@@ -537,10 +537,10 @@ + fdout = ostream->sm.sm_int0; + if (pfork() == 0) + { /* the child --- replace standard in and out with descriptors given */ +- close(0); +- massert(dup(fdin)>=0); +- close(1); +- massert(dup(fdout)>=0); ++ massert(dup2(fdin, 0)>=0); ++ massert(dup2(fdout, 1)>=0); ++ close(fdin); ++ close(fdout); + fprintf(stderr, "\n***** Spawning process %s ", pname); + if (execvp(pname, argv) == -1) + { diff --git a/gcl-2.6.12-largefile.patch b/gcl-2.6.12-largefile.patch new file mode 100644 index 0000000..4e30b28 --- /dev/null +++ b/gcl-2.6.12-largefile.patch @@ -0,0 +1,935 @@ +--- ./configure.orig 2014-10-28 12:00:00.000000000 -0600 ++++ ./configure 2014-10-28 12:00:00.000000000 -0600 +@@ -769,6 +769,7 @@ enable_static + enable_pic + enable_oldgmp + enable_dynsysgmp ++enable_largefile + with_x + enable_readline + enable_ansi +@@ -1440,6 +1441,7 @@ debug safecdr code + + --enable-dynsysgmp will link against the system libgmp3 overriding certain functions with patched versions from the local source + ++ --disable-largefile omit support for large files + --enable-readline enables command line completion via the readline library + --enable-ansi builds a large gcl aiming for ansi compliance, + --disable-ansi builds the smaller traditional CLtL1 image +@@ -5157,6 +5159,205 @@ ac_link='$CC -o conftest$ac_exeext $CFLA + ac_compiler_gnu=$ac_cv_c_compiler_gnu + + ++# Check whether --enable-largefile was given. ++if test "${enable_largefile+set}" = set; then : ++ enableval=$enable_largefile; ++fi ++ ++if test "$enable_largefile" != no; then ++ ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5 ++$as_echo_n "checking for special C compiler options needed for large files... " >&6; } ++if ${ac_cv_sys_largefile_CC+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ ac_cv_sys_largefile_CC=no ++ if test "$GCC" != yes; then ++ ac_save_CC=$CC ++ while :; do ++ # IRIX 6.2 and later do not support large files by default, ++ # so use the C compiler's -n32 option if that helps. ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++#include ++ /* Check that off_t can represent 2**63 - 1 correctly. ++ We can't simply define LARGE_OFF_T to be 9223372036854775807, ++ since some C++ compilers masquerading as C compilers ++ incorrectly reject 9223372036854775807. */ ++#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) ++ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 ++ && LARGE_OFF_T % 2147483647 == 1) ++ ? 1 : -1]; ++int ++main () ++{ ++ ++ ; ++ return 0; ++} ++_ACEOF ++ if ac_fn_c_try_compile "$LINENO"; then : ++ break ++fi ++rm -f core conftest.err conftest.$ac_objext ++ CC="$CC -n32" ++ if ac_fn_c_try_compile "$LINENO"; then : ++ ac_cv_sys_largefile_CC=' -n32'; break ++fi ++rm -f core conftest.err conftest.$ac_objext ++ break ++ done ++ CC=$ac_save_CC ++ rm -f conftest.$ac_ext ++ fi ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5 ++$as_echo "$ac_cv_sys_largefile_CC" >&6; } ++ if test "$ac_cv_sys_largefile_CC" != no; then ++ CC=$CC$ac_cv_sys_largefile_CC ++ fi ++ ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5 ++$as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; } ++if ${ac_cv_sys_file_offset_bits+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ while :; do ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++#include ++ /* Check that off_t can represent 2**63 - 1 correctly. ++ We can't simply define LARGE_OFF_T to be 9223372036854775807, ++ since some C++ compilers masquerading as C compilers ++ incorrectly reject 9223372036854775807. */ ++#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) ++ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 ++ && LARGE_OFF_T % 2147483647 == 1) ++ ? 1 : -1]; ++int ++main () ++{ ++ ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_compile "$LINENO"; then : ++ ac_cv_sys_file_offset_bits=no; break ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++#define _FILE_OFFSET_BITS 64 ++#include ++ /* Check that off_t can represent 2**63 - 1 correctly. ++ We can't simply define LARGE_OFF_T to be 9223372036854775807, ++ since some C++ compilers masquerading as C compilers ++ incorrectly reject 9223372036854775807. */ ++#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) ++ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 ++ && LARGE_OFF_T % 2147483647 == 1) ++ ? 1 : -1]; ++int ++main () ++{ ++ ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_compile "$LINENO"; then : ++ ac_cv_sys_file_offset_bits=64; break ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++ ac_cv_sys_file_offset_bits=unknown ++ break ++done ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5 ++$as_echo "$ac_cv_sys_file_offset_bits" >&6; } ++case $ac_cv_sys_file_offset_bits in #( ++ no | unknown) ;; ++ *) ++cat >>confdefs.h <<_ACEOF ++#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits ++_ACEOF ++;; ++esac ++rm -rf conftest* ++ if test $ac_cv_sys_file_offset_bits = unknown; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5 ++$as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; } ++if ${ac_cv_sys_large_files+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ while :; do ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++#include ++ /* Check that off_t can represent 2**63 - 1 correctly. ++ We can't simply define LARGE_OFF_T to be 9223372036854775807, ++ since some C++ compilers masquerading as C compilers ++ incorrectly reject 9223372036854775807. */ ++#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) ++ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 ++ && LARGE_OFF_T % 2147483647 == 1) ++ ? 1 : -1]; ++int ++main () ++{ ++ ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_compile "$LINENO"; then : ++ ac_cv_sys_large_files=no; break ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++#define _LARGE_FILES 1 ++#include ++ /* Check that off_t can represent 2**63 - 1 correctly. ++ We can't simply define LARGE_OFF_T to be 9223372036854775807, ++ since some C++ compilers masquerading as C compilers ++ incorrectly reject 9223372036854775807. */ ++#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) ++ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 ++ && LARGE_OFF_T % 2147483647 == 1) ++ ? 1 : -1]; ++int ++main () ++{ ++ ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_compile "$LINENO"; then : ++ ac_cv_sys_large_files=1; break ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++ ac_cv_sys_large_files=unknown ++ break ++done ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5 ++$as_echo "$ac_cv_sys_large_files" >&6; } ++case $ac_cv_sys_large_files in #( ++ no | unknown) ;; ++ *) ++cat >>confdefs.h <<_ACEOF ++#define _LARGE_FILES $ac_cv_sys_large_files ++_ACEOF ++;; ++esac ++rm -rf conftest* ++ fi ++ ++ ++fi + + + # can only test for numbers -- CM +--- ./configure.in.orig 2014-10-28 12:00:00.000000000 -0600 ++++ ./configure.in 2014-10-28 12:00:00.000000000 -0600 +@@ -472,7 +472,7 @@ AC_USE_SYSTEM_EXTENSIONS + AC_PROG_CC + AC_PROG_CPP + AC_SUBST(CC) +- ++AC_SYS_LARGEFILE + + # can only test for numbers -- CM + # if test "${GCC}" -eq "yes" ; then +--- ./h/linux.h.orig 2014-10-23 15:29:00.000000000 -0600 ++++ ./h/linux.h 2014-10-28 12:00:00.000000000 -0600 +@@ -12,13 +12,13 @@ + #include + #define SEEK_TO_END_OFILE(fp)\ + do { \ +- long offset = 0, endofelf; int j; \ ++ off_t offset = 0, endofelf; int j; \ + ElfW(Ehdr) eheader; ElfW(Shdr) shdr; \ +- fseek(fp, 0, SEEK_SET); \ ++ fseeko(fp, 0, SEEK_SET); \ + massert(1==fread(&eheader, sizeof(eheader), 1, fp)); \ + /* in case the headers themselves come AFTER the actual sections */ \ + endofelf=offset = eheader.e_shoff+ eheader.e_shentsize *eheader.e_shnum;\ +- fseek(fp, eheader.e_shoff, SEEK_SET); \ ++ fseeko(fp, eheader.e_shoff, SEEK_SET); \ + if ( eheader.e_shentsize != sizeof(ElfW(Shdr)) ) \ + { FEerror("Bad ELF section header size",0); } \ + for ( j = 0; j < eheader.e_shnum; j++ ) \ +@@ -26,7 +26,7 @@ + if ( (shdr.sh_offset > offset) && (shdr.sh_type != SHT_NOBITS) ) \ + { offset = shdr.sh_offset; endofelf = offset+shdr.sh_size; } \ + } \ +- if ( fseek(fp, endofelf, SEEK_SET) ) \ ++ if ( fseeko(fp, endofelf, SEEK_SET) ) \ + FEerror("Bad ELF file",0); \ + } while(0) + +--- ./h/mp.h.orig 2014-10-23 15:29:00.000000000 -0600 ++++ ./h/mp.h 2014-10-28 12:00:00.000000000 -0600 +@@ -33,6 +33,22 @@ typedef struct + + #define SI_TO_MP(x, temp) (mpz_set_si(MP(temp),(x)), MP(temp)) + ++#define C_INT_TO_OBJ(x) ({ \ ++ object temp = big_fixnum1; \ ++ if (x >= MOST_NEGATIVE_FIX && x <= MOST_POSITIVE_FIX) \ ++ temp = make_fixnum(x); \ ++ else if (sizeof(x) <= sizeof(long)) \ ++ mpz_set_si(MP(big_fixnum1), x); \ ++ else if (x < 0) { \ ++ __typeof__(x) y = -x; \ ++ mpz_import(MP(big_fixnum2), 1U, 1, sizeof(x), 0, 0U, &y); \ ++ mpz_neg(MP(big_fixnum1), MP(big_fixnum2)); \ ++ } else { \ ++ __typeof__(x) y = x; \ ++ mpz_import(MP(big_fixnum1), 1U, 1, sizeof(x), 0, 0U, &y); \ ++ } \ ++ temp; \ ++}) + + #define INTEGER_TO_MP(x, temp ) \ + (type_of(x) == t_bignum ? MP(x) : SI_TO_MP(fix(x), temp)) +@@ -108,6 +124,20 @@ GEN subss(); + + #define SI_TO_MP(x,ignore) stoi(x) + ++#define C_INT_TO_OBJ(x) ({ \ ++ object temp = big_fixnum1; \ ++ if (x >= MOST_NEGATIVE_FIX && x <= MOST_POSITIVE_FIX) \ ++ temp = make_fixnum(x); \ ++ else if (sizeof(x) <= sizeof(long)) \ ++ MP(big_fixnum1) = stoi(x); \ ++ else if (x < 0) { \ ++ __typeof__(x) y = -x; \ ++ MP(big_fixnum1) = uutoineg((y) >> (sizeof(ulong) * 8), (y) & (ulong)-1); \ ++ } else \ ++ MP(big_fixnum1) = uutoi((x) >> (sizeof(ulong) * 8), (x) & (ulong)-1); \ ++ temp; \ ++}) ++ + #define INT_FLAG 0x1010000 + + #define MP_ALLOCATED(x) (x)->big.big_length +--- ./h/protoize.h.orig 2014-10-23 15:29:00.000000000 -0600 ++++ ./h/protoize.h 2014-10-28 12:00:00.000000000 -0600 +@@ -512,7 +512,7 @@ typedef void (*funcvoid)(void); + /* unixfsys.c:329:OF */ extern bool file_exists (object file); /* (file) object file; */ + /* unixfsys.c:359:OF */ extern FILE *backup_fopen (char *filename, char *option); /* (filename, option) char *filename; char *option; */ + /* unixfsys.c:359:OF */ extern FILE *fopen_not_dir (char *filename, char *option); /* (filename, option) char *filename; char *option; */ +-/* unixfsys.c:372:OF */ extern int file_len (FILE *fp); /* (fp) FILE *fp; */ ++/* unixfsys.c:372:OF */ extern off_t file_len (FILE *fp); /* (fp) FILE *fp; */ + /* unixfsys.c:382:OF */ extern object truename (object); /* () */ + /* unixfsys.c:382:OF */ extern void Ltruename (void); /* () */ + /* unixfsys.c:418:OF */ extern object fSsetenv (object variable, object value); /* (variable, value) object variable; object value; */ +@@ -738,11 +738,11 @@ edit_double(int, double, int *, char *, + void + sethash(object,object,object); + +-int ++off_t + file_position(object); + + int +-file_position_set(object, int); ++file_position_set(object, off_t); + + void + princ_str(char *s, object); +--- ./o/fasdump.c.orig 2014-10-23 15:29:00.000000000 -0600 ++++ ./o/fasdump.c 2014-10-28 12:00:00.000000000 -0600 +@@ -23,6 +23,7 @@ + #ifndef FAT_STRING + #include "include.h" + #endif ++#include "num_include.h" + + static void + clrhash(object); +@@ -608,7 +609,7 @@ DEFUN_NEW("OPEN-FASD",object,fSopen_fasd + fd->eof=eof; + fd->index=small_fixnum(0); + fd->package=symbol_value(sLApackageA); +- fd->filepos = make_fixnum(file_position(stream)); ++ fd->filepos = C_INT_TO_OBJ(file_position(stream)); + + SETUP_FASD_IN(fd); + if (direction==sKoutput){ +@@ -649,7 +650,7 @@ DEFUN_NEW("CLOSE-FASD",object,fSclose_fa + {clrhash(fd->table); + SETUP_FASD_IN(fd); + PUT_OP(d_end_of_file); +- {int i = file_position(fd->stream); ++ {off_t i = file_position(fd->stream); + if(type_of(fd->filepos) == t_fixnum) + { file_position_set(fd->stream,fix(fd->filepos) +2); + /* record the length of array needed to read the indices */ +--- ./o/file.d.orig 2014-10-23 15:29:00.000000000 -0600 ++++ ./o/file.d 2014-10-28 12:00:00.000000000 -0600 +@@ -37,6 +37,7 @@ Foundation, 675 Mass Ave, Cambridge, MA + + #define IN_FILE + #include "include.h" ++#include "num_include.h" + + #ifdef HAVE_READLINE + #define kclgetc(FP) rl_getc_em(((FILE *)FP)) +@@ -394,7 +395,7 @@ object if_exists, if_does_not_exist; + FEerror("Cannot write pipe output to temporary file",0); + if (pclose(pp)<0) + FEerror("Cannot close zcat pipe",0); +- if (fseek(fp,0,SEEK_SET)) ++ if (fseeko(fp,0,SEEK_SET)) + FEerror("Cannot rewind temporary file\n",0); + goto AGAIN; + } +@@ -1308,7 +1309,7 @@ BEGIN: + } + } + +-int ++off_t + file_position(strm) + object strm; + { +@@ -1320,7 +1321,7 @@ BEGIN: + /* return(strm->sm.sm_int0); */ + if (strm->sm.sm_fp == NULL) + closed_stream(strm); +- return(ftell(strm->sm.sm_fp)); ++ return(ftello(strm->sm.sm_fp)); + case smm_socket: + return -1; + +@@ -1351,7 +1352,7 @@ BEGIN: + int + file_position_set(strm, disp) + object strm; +-int disp; ++off_t disp; + { + BEGIN: + switch (strm->sm.sm_mode) { +@@ -1361,7 +1362,7 @@ BEGIN: + case smm_output: + case smm_io: + +- if (fseek(strm->sm.sm_fp, disp, 0) < 0) ++ if (fseeko(strm->sm.sm_fp, disp, 0) < 0) + return(-1); + /* strm->sm.sm_int0 = disp; */ + return(0); +@@ -1397,7 +1398,7 @@ BEGIN: + } + } + +-static int ++static off_t + file_length(strm) + object strm; + { +@@ -1763,14 +1764,14 @@ LFD(Lstream_element_type)() + @) + + @(defun file_position (file_stream &o position) +- int i=0; ++ off_t i=0; + @ + check_type_stream(&file_stream); + if (position == Cnil) { + i = file_position(file_stream); + if (i < 0) + @(return Cnil) +- @(return `make_fixnum(i)`) ++ @(return `C_INT_TO_OBJ(i)`) + } else { + if (position == sKstart) + i = 0; +@@ -1797,7 +1798,7 @@ LFD(Lfile_length)() + if (i < 0) + vs_base[0] = Cnil; + else +- vs_base[0] = make_fixnum(i); ++ vs_base[0] = C_INT_TO_OBJ(i); + } + + object sSAload_pathnameA; +@@ -2704,22 +2705,22 @@ read_fasl_data(const char *str) { + #ifdef BSD + fp = faslfile->sm.sm_fp; + fread(&header, sizeof(header), 1, fp); +- fseek(fp, ++ fseeko(fp, + header.a_text+header.a_data+ + header.a_syms+header.a_trsize+header.a_drsize, + 1); + fread(&i, sizeof(i), 1, fp); +- fseek(fp, i - sizeof(i), 1); ++ fseeko(fp, i - sizeof(i), 1); + #endif + + #ifdef HAVE_FILEHDR + fp = faslfile->sm.sm_fp; + fread(&fileheader, sizeof(fileheader), 1, fp); +- fseek(fp, ++ fseeko(fp, + fileheader.f_symptr+fileheader.f_nsyms*SYMESZ, + 0); + fread(&i, sizeof(i), 1, fp); +- fseek(fp, i - sizeof(i), 1); ++ fseeko(fp, i - sizeof(i), 1); + while ((i = getc(fp)) == 0) + ; + ungetc(i, fp); +@@ -2728,7 +2729,7 @@ read_fasl_data(const char *str) { + #ifdef E15 + fp = faslfile->sm.sm_fp; + fread(&header, sizeof(header), 1, fp); +- fseek(fp, ++ fseeko(fp, + header.a_text+header.a_data+ + header.a_syms+header.a_trsize+header.a_drsize, + 1); +--- ./o/sfasl.c.orig 2014-10-23 15:29:00.000000000 -0600 ++++ ./o/sfasl.c 2014-10-28 12:00:00.000000000 -0600 +@@ -148,7 +148,7 @@ void set_symbol_address ( struct syment + int + fasload(faslfile) + object faslfile; +-{ long fasl_vector_start; ++{ off_t fasl_vector_start; + struct filehdr fileheader; + struct sfasl_info sfasl_info_buf; + #ifdef COFF +@@ -210,7 +210,7 @@ object faslfile; + symbol_table = + (struct syment *) OUR_ALLOCA(sizeof(struct syment)* + (unsigned int)nsyms); +- fseek(fp,(int)( N_SYMOFF(fileheader)), 0); ++ fseeko(fp,(off_t)( N_SYMOFF(fileheader)), 0); + { + for (i = 0; i < nsyms; i++) + { fread((char *)&symbol_table[i], SYMESZ, 1, fp); +@@ -221,7 +221,7 @@ object faslfile; + symbol_table[i].n_un.n_strx = string_size; + dprintf(string_size %d, string_size); + string_size += symbol_table[i].n_length + 1; +- fseek(fp,(int)symbol_table[i].n_length,1); ++ fseeko(fp,(off_t)symbol_table[i].n_length,1); + #endif + } + } +@@ -238,13 +238,13 @@ my_string_table=READ_IN_STRING_TABLE(fp, + + #else + #ifdef MUST_SEEK_TO_STROFF +- fseek(fp,N_STROFF(fileheader),0); ++ fseeko(fp,N_STROFF(fileheader),0); + #endif + {int ii=0; + if (!fread((char *)&ii,sizeof(int),1,fp)) + {FEerror("The string table of this file did not have any length",0, + 0);} +- fseek(fp,-4,1); ++ fseeko(fp,-4,1); + /* at present the string table is located just after the symbols */ + my_string_table=OUR_ALLOCA((unsigned int)ii); + dprintf( string table leng = %d, ii); +@@ -261,7 +261,7 @@ SEEK_TO_END_OFILE(fp); + ungetc(i, fp); + #endif + +- fasl_vector_start=ftell(fp); ++ fasl_vector_start=ftello(fp); + + if (!((c_table.ptable) && *(c_table.ptable))) + build_symbol_table(); +@@ -293,7 +293,7 @@ SEEK_TO_END_OFILE(fp); + #endif + + dprintf( code size %d , datasize+textsize+bsssize + extra_bss); +- if (fseek(fp,N_TXTOFF(fileheader) ,0) < 0) ++ if (fseeko(fp,N_TXTOFF(fileheader) ,0) < 0) + FEerror("file seek error",0,0); + SAFE_FREAD(the_start, textsize + datasize, 1, fp); + dprintf(read into memory text +data %d bytes, textsize + datasize); +@@ -307,7 +307,7 @@ SEEK_TO_END_OFILE(fp); + {int j=0; + for(j=1; j< BSS_NSCN ; j++) + { dprintf( relocating section %d \n,j); +- if (section[j].s_nreloc) fseek(fp,section[j].s_relptr,0); ++ if (section[j].s_nreloc) fseeko(fp,section[j].s_relptr,0); + for(i=0; i < section[j].s_nreloc; i++) + { struct syment *sym; + fread(&relocation_info, RELSZ, 1, fp); +@@ -326,7 +326,7 @@ SEEK_TO_END_OFILE(fp); + {int j=0; + for(j=1; j< BSS_NSCN ; j++) + { dprintf( relocating section %d \n,j); +- if (section[j].s_nreloc) fseek(fp,section[j].s_relptr,0); ++ if (section[j].s_nreloc) fseeko(fp,section[j].s_relptr,0); + #ifdef ADJUST_RELOC_START + ADJUST_RELOC_START(j) + #endif +@@ -338,7 +338,7 @@ ADJUST_RELOC_START(j) + }}; + #endif + #ifdef BSD +- fseek(fp,N_RELOFF(fileheader),0); ++ fseeko(fp,N_RELOFF(fileheader),0); + {int nrel = (fileheader.a_trsize/sizeof(struct reloc)); + for (i=0; i < nrel; i++) + {fread((char *)&relocation_info, sizeof(struct reloc), +@@ -348,7 +348,7 @@ ADJUST_RELOC_START(j) + } + } + #ifdef N_DRELOFF +- fseek (fp, N_DRELOFF(fileheader), 0); ++ fseeko (fp, N_DRELOFF(fileheader), 0); + #endif + {int nrel = (fileheader.a_drsize/sizeof(struct reloc)); + the_start += fileheader.a_text; +@@ -369,7 +369,7 @@ ADJUST_RELOC_START(j) + dprintf( datasize is %x,datasize); + + /* read in the fasl vector */ +- fseek(fp,fasl_vector_start,0); ++ fseeko(fp,fasl_vector_start,0); + if (feof(fp)) + {data=0;} + else{ +--- ./o/unexelf.c.orig 2014-10-23 15:29:00.000000000 -0600 ++++ ./o/unexelf.c 2014-10-28 12:00:00.000000000 -0600 +@@ -634,7 +634,8 @@ find_section (char *name, char *section_ + static void + unexec (char *new_name, char *old_name, unsigned int data_start, unsigned int bss_start, unsigned int entry_address) + { +- int new_file, old_file, new_file_size; ++ int new_file, old_file; ++ off_t new_file_size; + + /* Pointers to the base of the image of the two files. */ + caddr_t old_base, new_base; +@@ -664,7 +665,7 @@ unexec (char *new_name, char *old_name, + int old_data_index, new_data2_index; + int old_mdebug_index; + struct stat stat_buf; +- int old_file_size; ++ size_t old_file_size; + + /* Open the old file, allocate a buffer of the right size, and read + in the file contents. */ +@@ -687,7 +688,7 @@ unexec (char *new_name, char *old_name, + we'd dump our temporary buffers with Emacs, and we'd have to be + extra careful to use the correct value of sbrk(0) after + allocating all buffers in the code below, which we aren't. */ +- old_file_size = stat_buf.st_size; ++ old_file_size = (size_t) stat_buf.st_size; + old_base = mmap (NULL, old_file_size, PROT_READ,MAP_SHARED, old_file, 0); + if (old_base == MAP_FAILED) + fatal ("Can't allocate buffer for %s\n", old_name); +@@ -780,7 +781,7 @@ unexec (char *new_name, char *old_name, + if (ftruncate (new_file, new_file_size)) + fatal ("Can't ftruncate (%s): errno %d\n", new_name, errno); + +- new_base = mmap (NULL, new_file_size, PROT_READ | PROT_WRITE,MAP_SHARED, new_file, 0); ++ new_base = mmap (NULL, (size_t) new_file_size, PROT_READ | PROT_WRITE,MAP_SHARED, new_file, 0); + if (new_base == MAP_FAILED) + fatal ("Can't allocate buffer for %s\n", old_name); + +@@ -1216,7 +1217,7 @@ unexec (char *new_name, char *old_name, + /* new_file_size, new_base, errno); */ + + munmap (old_base, old_file_size); +- munmap (new_base, new_file_size); ++ munmap (new_base, (size_t) new_file_size); + + /* Close the files and make the new file executable. */ + +--- ./o/unixfasl.c.orig 2014-10-23 15:29:00.000000000 -0600 ++++ ./o/unixfasl.c 2014-10-28 12:00:00.000000000 -0600 +@@ -90,8 +90,8 @@ object faslfile; + #ifdef ATT + struct filehdr fileheader; + struct scnhdr sectionheader; +- int textsize, datasize, bsssize; +- int textstart; ++ off_t textsize, datasize, bsssize; ++ off_t textstart; + #endif + + #ifdef E15 +@@ -129,7 +129,7 @@ object faslfile; + #ifdef ATT + fread(&fileheader, sizeof(fileheader), 1, fp); + #ifdef S3000 +- if(fileheader.f_opthdr != 0) fseek(fp,fileheader.f_opthdr,1); ++ if(fileheader.f_opthdr != 0) fseeko(fp,fileheader.f_opthdr,1); + #endif + fread(§ionheader, sizeof(sectionheader), 1, fp); + textsize = sectionheader.s_size; +@@ -162,27 +162,27 @@ object faslfile; + SEEK_TO_END_OFILE(fp); + #else + #ifdef BSD +- fseek(fp, ++ fseeko(fp, + header.a_text+header.a_data+ + header.a_syms+header.a_trsize+header.a_drsize, + 1); + fread(&i, sizeof(i), 1, fp); +- fseek(fp, i - sizeof(i), 1); ++ fseeko(fp, i - sizeof(i), 1); + #endif + + #ifdef ATT +- fseek(fp, ++ fseeko(fp, + fileheader.f_symptr + SYMESZ*fileheader.f_nsyms, + 0); + fread(&i, sizeof(i), 1, fp); +- fseek(fp, i - sizeof(i), 1); ++ fseeko(fp, i - sizeof(i), 1); + while ((i = getc(fp)) == 0) + ; + ungetc(i, fp); + #endif + + #ifdef E15 +- fseek(fp, ++ fseeko(fp, + header.a_text+header.a_data+ + header.a_syms+header.a_trsize+header.a_drsize, + 1); +@@ -255,7 +255,7 @@ AGAIN: + } + #endif + +- if (fseek(fp, textstart, 0) < 0) ++ if (fseeko(fp, textstart, 0) < 0) + error("file seek error"); + + fread(memory->cfd.cfd_start, textsize + datasize, 1, fp); +@@ -334,12 +334,12 @@ SEEK_TO_END_OFILE(faslfile->sm.sm_fp); + #else + fp = faslfile->sm.sm_fp; + fread(&faslheader, sizeof(faslheader), 1, fp); +- fseek(fp, ++ fseeko(fp, + faslheader.a_text+faslheader.a_data+ + faslheader.a_syms+faslheader.a_trsize+faslheader.a_drsize, + 1); + fread(&i, sizeof(i), 1, fp); +- fseek(fp, i - sizeof(i), 1); ++ fseeko(fp, i - sizeof(i), 1); + #endif + data = read_fasl_vector(faslfile); + vs_push(data); +@@ -361,7 +361,7 @@ SEEK_TO_END_OFILE(faslfile->sm.sm_fp); + vs_push(tempfile); + fp = tempfile->sm.sm_fp; + +- if (fseek(fp, textstart, 0) < 0) ++ if (fseeko(fp, textstart, 0) < 0) + error("file seek error"); + + fread(memory->cfd.cfd_start, textsize + datasize, 1, fp); +--- ./o/unixfsys.c.orig 2014-10-28 12:00:00.000000000 -0600 ++++ ./o/unixfsys.c 2014-10-28 12:00:00.000000000 -0600 +@@ -26,6 +26,7 @@ Foundation, 675 Mass Ave, Cambridge, MA + + #define IN_UNIXFSYS + #include "include.h" ++#include "num_include.h" + #include + #include + #ifndef NO_PWD_H +@@ -414,7 +415,7 @@ backup_fopen(char *filename, char *optio + return(fopen(filename, option)); + } + +-int ++off_t + file_len(FILE *fp) + { + struct stat filestatus; +@@ -523,7 +524,7 @@ DEFUN_NEW("STAT",object,fSstat,SI,1,1,NO + filename[j-1]=0;*/ + RETURN1(list(3,S_ISDIR(ss.st_mode) ? sKdirectory : + (S_ISLNK(ss.st_mode) ? sKlink : sKfile), +- make_fixnum(ss.st_size),make_fixnum(ss.st_ctime))); ++ C_INT_TO_OBJ(ss.st_size),make_fixnum(ss.st_ctime))); + } + } + +--- ./o/unixsave.c.orig 2014-10-23 15:29:00.000000000 -0600 ++++ ./o/unixsave.c 2014-10-28 12:00:00.000000000 -0600 +@@ -93,7 +93,7 @@ memory_save(original_file, save_file) + char *original_file, *save_file; + { MEM_SAVE_LOCALS; + char *data_begin, *data_end; +- int original_data; ++ off_t original_data = 0; + FILE *original, *save; + register int n; + register char *p; +@@ -130,7 +130,7 @@ char *original_file, *save_file; + } else + break; + +- fseek(original, original_data, 1); ++ fseeko(original, original_data, 1); + + COPY_TO_SAVE; + +--- ./unixport/bsd_rsym.c.orig 2014-10-23 15:29:00.000000000 -0600 ++++ ./unixport/bsd_rsym.c 2014-10-28 12:00:00.000000000 -0600 +@@ -121,7 +121,7 @@ tab.n_symbols=0;tab.tot_leng=0; + symout=fopen(outfile,"w"); + if (!symout) + {perror(outfile); exit(1);}; +- fseek(symout,sizeof(struct lsymbol_table),0); ++ fseeko(symout,sizeof(struct lsymbol_table),0); + end = my_symbol_table + NSYMS(my_header); + for (p = my_symbol_table; p < end; p++) { + /* +@@ -146,7 +146,7 @@ tab.n_symbols=0;tab.tot_leng=0; + dprintf( index , (int) (p - my_symbol_table) / sizeof(struct syment)); + p = p + NUM_AUX(p); } + } +- fseek(symout,0,0); ++ fseeko(symout,0,0); + fwrite(&tab,sizeof(tab),1,symout); + fclose(symout); + return 0; +--- ./unixport/rsym.c.orig 2014-10-23 15:29:00.000000000 -0600 ++++ ./unixport/rsym.c 2014-10-28 12:00:00.000000000 -0600 +@@ -102,7 +102,7 @@ char *filename; + sizeof(struct syment) and SYMESZ are not always the same. + */ + +- if(fseek(fp,(int)(N_SYMOFF(my_header)),0)) ++ if(fseeko(fp,(off_t)(N_SYMOFF(my_header)),0)) + {fprintf(stderr,"seek error"); + exit(1);} + +@@ -113,7 +113,7 @@ char *filename; + dprintf(string_size %d,string_size); + symbol_table[i].n_un.n_strx = string_size; + string_size += symbol_table[i].n_length + 1; +- fseek(fp,symbol_table[i].n_length,1); ++ fseeko(fp,symbol_table[i].n_length,1); + } + #else + fread((char *)&symbol_table[i], SYMESZ, 1, fp); +@@ -127,14 +127,14 @@ char *filename; + strings follow symbol table! */ + #ifndef HPUX + #ifdef N_STROFF +- fseek(fp,N_STROFF(my_header),0); ++ fseeko(fp,N_STROFF(my_header),0); + #endif + if (fread((char *)&string_size, 4, 1, fp) > 0) { + my_string_table = malloc(string_size); + if(debug) +- {printf(" string_size is %d fseek %d ",string_size,fseek(fp,string_size-1,1)); +- printf(" fseek back %d ",fseek(fp,1-string_size,1));}; +- fseek(fp, -4, 1); ++ {printf(" string_size is %d fseek %zd ",string_size,fseeko(fp,string_size-1,1)); ++ printf(" fseek back %d ",fseeko(fp,1-string_size,1));}; ++ fseeko(fp, -4, 1); + if(string_size!=(fread(my_string_table, 1, string_size, fp))) + {dprintf( string_size was %d ,string_size); + perror("rsym could not read bad string table") ; +@@ -149,10 +149,10 @@ char *filename; + int slen; + p = my_string_table=malloc((unsigned int)string_size); + dprintf( string table leng = %d, string_size); +- fseek(fp,(int)( LESYM_OFFSET(my_header)), 0); ++ fseeko(fp,(off_t)( LESYM_OFFSET(my_header)), 0); + for (i = 0; i < nsyms; i++) + { +- fseek(fp,SYMESZ, 1); ++ fseeko(fp,SYMESZ, 1); + slen = symbol_table[i].n_length; + dprintf( slen = %d,slen); + fread(p,slen,1,fp); +@@ -182,7 +182,7 @@ char *out; + symout=fopen(out,"wr"); + if (!symout) + {perror(out); exit(1);}; +- fseek(symout,sizeof(struct lsymbol_table),0); ++ fseeko(symout,sizeof(struct lsymbol_table),0); + end = symbol_table + nsyms; + for (p = symbol_table; p < end; p++) { + /* +@@ -219,7 +219,7 @@ char *out; + dprintf( index , (int) (p - symbol_table) / sizeof(struct syment)); + p = p + NUM_AUX(p); } + } +- fseek(symout,0,0); ++ fseeko(symout,0,0); + fwrite(&tab,sizeof(tab),1,symout); + fclose(symout); + #ifdef AIX3 +@@ -323,7 +323,7 @@ char *out; + symin=fopen(out,"w"); + if(symin==0) perror("can't open"); + fwrite(&tab,sizeof(tab),1,symin); +- fseek(symin,sizeof(tab),0); ++ fseeko(symin,sizeof(tab),0); + {int i,j; + unsigned short k; + for (i=0 ; i < tab.n_symbols ; i++) +--- ./unixport/rsym_elf.c.orig 2014-10-23 15:29:00.000000000 -0600 ++++ ./unixport/rsym_elf.c 2014-10-28 12:00:00.000000000 -0600 +@@ -147,7 +147,7 @@ get_section(fp,name) + else + shndx = get_section_number(name); + { +- fseek(fp,SECTION_H(shndx).sh_offset,SEEK_SET); ++ fseeko(fp,SECTION_H(shndx).sh_offset,SEEK_SET); + ans = malloc(SECTION_H(shndx).sh_size); + fread(ans,SECTION_H(shndx).sh_size,1,fp); + return ans; +@@ -173,7 +173,7 @@ char *filename; + } + + fread(&eheader,sizeof(eheader),1,fp); +- fseek(fp,eheader.e_ehsize,SEEK_SET); ++ fseeko(fp,eheader.e_ehsize,SEEK_SET); + fread(&pheader,sizeof(pheader),1,fp); + + if(ELFMAG0 != eheader.e_ident[0]){ +@@ -182,7 +182,7 @@ char *filename; + + section_headers = (void *)malloc(sizeof(ElfW(Shdr))* + (1+ eheader.e_shnum)); +- fseek(fp,eheader.e_shoff,0); ++ fseeko(fp,eheader.e_shoff,0); + for (i=0 ; i< eheader.e_shnum ; i++) + fread(§ion_headers[i],eheader.e_shentsize,1,fp); + +@@ -196,7 +196,7 @@ char *filename; + sizeof(struct syment) and SYMESZ are not always the same. + */ + +- if(fseek(fp,(int)SECTION_H(symbol_index).sh_offset,0)) ++ if(fseeko(fp,(off_t)SECTION_H(symbol_index).sh_offset,0)) + {fprintf(stderr,"seek error"); + exit(1);} + +@@ -242,7 +242,7 @@ char *out; + symout=fopen(out,"wr"); + if (!symout) + {perror(out); exit(1);}; +- fseek(symout,sizeof(struct lsymbol_table),0); ++ fseeko(symout,sizeof(struct lsymbol_table),0); + end = symbol_table + nsyms; + for (p = symbol_table; p < end; p++) { + /* +@@ -300,7 +300,7 @@ char *out; + dprintf( index , (int) (p - symbol_table) / sizeof(STRUCT_SYMENT)); + p = p + NUM_AUX(p); } + } +- fseek(symout,0,0); ++ fseeko(symout,0,0); + fwrite(&tab,sizeof(tab),1,symout); + fclose(symout); + #ifdef AIX3 diff --git a/gcl-2.6.12-selinux.patch b/gcl-2.6.12-selinux.patch new file mode 100644 index 0000000..c3418d0 --- /dev/null +++ b/gcl-2.6.12-selinux.patch @@ -0,0 +1,257 @@ +diff -durpN gcl-2.6.12.ORIG/clcs/makefile gcl-2.6.12/clcs/makefile +--- gcl-2.6.12.ORIG/clcs/makefile 2014-10-23 15:29:00.000000000 -0600 ++++ gcl-2.6.12/clcs/makefile 2014-10-28 11:50:44.623943474 -0600 +@@ -9,6 +9,7 @@ all: $(addsuffix .c,$(FILES)) $(addsuffi + + saved_clcs_gcl: ../unixport/saved_pcl_gcl$(EXE) + echo '(load "package.lisp")(load "myload.lisp")(si::save-system "$@")' | $< $(/dev/null 2>&1 ; then if grep -i oncrpc makedefs >/dev/null 2>&1 ; then cp /mingw/bin/oncrpc.dll $(DESTDIR)$(INSTALL_LIB_DIR)/$(PORTDIR); fi ; fi + cd $(DESTDIR)$(INSTALL_LIB_DIR)/$(PORTDIR) && \ + mv $(FLISP)$(EXE) temp$(EXE) && \ ++ ( chcon -t gcl_exec_t temp$(EXE) || true ) && \ + echo '(reset-sys-paths "$(INSTALL_LIB_DIR)/")(si::save-system "$(FLISP)$(EXE)")' | ./temp$(EXE) && \ + rm -f temp$(EXE) + if [ -e "unixport/rsym$(EXE)" ] ; then cp unixport/rsym$(EXE) $(DESTDIR)$(INSTALL_LIB_DIR)/unixport/ ; fi +diff -durpN gcl-2.6.12.ORIG/selinux/gcl.fc gcl-2.6.12/selinux/gcl.fc +--- gcl-2.6.12.ORIG/selinux/gcl.fc 1969-12-31 17:00:00.000000000 -0700 ++++ gcl-2.6.12/selinux/gcl.fc 2010-12-29 11:46:30.625141327 -0700 +@@ -0,0 +1,5 @@ ++/usr/lib64/gcl-[^/]+/unixport/saved_.* -- gen_context(system_u:object_r:gcl_exec_t,s0) ++/usr/lib/gcl-[^/]+/unixport/saved_.* -- gen_context(system_u:object_r:gcl_exec_t,s0) ++/usr/lib/maxima/[^/]+/binary-gcl/maxima -- gen_context(system_u:object_r:gcl_exec_t,s0) ++/usr/lib64/maxima/[^/]+/binary-gcl/maxima -- gen_context(system_u:object_r:gcl_exec_t,s0) ++ +diff -durpN gcl-2.6.12.ORIG/selinux/gcl.if gcl-2.6.12/selinux/gcl.if +--- gcl-2.6.12.ORIG/selinux/gcl.if 1969-12-31 17:00:00.000000000 -0700 ++++ gcl-2.6.12/selinux/gcl.if 2010-12-29 11:46:30.626141206 -0700 +@@ -0,0 +1,146 @@ ++ ++## policy for gcl ++ ++######################################## ++## ++## Execute a domain transition to run gcl. ++## ++## ++## ++## Domain allowed to transition. ++## ++## ++# ++interface(`gcl_domtrans',` ++ gen_require(` ++ type gcl_t; ++ type gcl_exec_t; ++ ') ++ ++ domtrans_pattern($1,gcl_exec_t,gcl_t) ++') ++ ++ ++######################################## ++## ++## Do not audit attempts to read, ++## gcl tmp files ++## ++## ++## ++## Domain to not audit. ++## ++## ++# ++interface(`gcl_dontaudit_read_tmp_files',` ++ gen_require(` ++ type gcl_tmp_t; ++ ') ++ ++ dontaudit $1 gcl_tmp_t:file read_file_perms; ++') ++ ++######################################## ++## ++## Allow domain to read, gcl tmp files ++## ++## ++## ++## Domain to not audit. ++## ++## ++# ++interface(`gcl_read_tmp_files',` ++ gen_require(` ++ type gcl_tmp_t; ++ ') ++ ++ allow $1 gcl_tmp_t:file read_file_perms; ++') ++ ++######################################## ++## ++## Allow domain to manage gcl tmp files ++## ++## ++## ++## Domain to not audit. ++## ++## ++# ++interface(`gcl_manage_tmp',` ++ gen_require(` ++ type gcl_tmp_t; ++ ') ++ ++ manage_dirs_pattern($1,gcl_tmp_t,gcl_tmp_t) ++ manage_files_pattern($1,gcl_tmp_t,gcl_tmp_t) ++ manage_lnk_files_pattern($1,gcl_tmp_t,gcl_tmp_t) ++') ++ ++######################################## ++## ++## Execute gcl in the gcl domain, and ++## allow the specified role the gcl domain. ++## ++## ++## ++## Domain allowed access ++## ++## ++## ++## ++## The role to be allowed the gcl domain. ++## ++## ++## ++## ++## The type of the role's terminal. ++## ++## ++# ++interface(`gcl_run',` ++ gen_require(` ++ type gcl_t; ++ ') ++ ++ gcl_domtrans($1) ++ role $2 types gcl_t; ++ dontaudit gcl_t $3:chr_file rw_term_perms; ++') ++ ++ ++######################################## ++## ++## All of the rules required to administrate ++## an gcl environment ++## ++## ++## ++## Domain allowed access. ++## ++## ++## ++## ++## The role to be allowed to manage the gcl domain. ++## ++## ++## ++## ++## The type of the user terminal. ++## ++## ++## ++# ++interface(`gcl_admin',` ++ gen_require(` ++ type gcl_t; ++ ') ++ ++ allow $1 gcl_t:process { ptrace signal_perms getattr }; ++ read_files_pattern($1, gcl_t, gcl_t) ++ ++ ++ gcl_manage_tmp($1) ++ ++') +diff -durpN gcl-2.6.12.ORIG/selinux/gcl.te gcl-2.6.12/selinux/gcl.te +--- gcl-2.6.12.ORIG/selinux/gcl.te 1969-12-31 17:00:00.000000000 -0700 ++++ gcl-2.6.12/selinux/gcl.te 2010-12-29 11:46:30.627141086 -0700 +@@ -0,0 +1,45 @@ ++policy_module(gcl,1.0.1) ++ ++######################################## ++# ++# Declarations ++# ++ ++type gcl_t; ++type gcl_exec_t; ++application_domain(gcl_t, gcl_exec_t) ++role system_r types gcl_t; ++ ++######################################## ++# ++# gcl local policy ++# ++ ++## internal communication is often done using fifo and unix sockets. ++allow gcl_t self:fifo_file rw_file_perms; ++allow gcl_t self:unix_stream_socket create_stream_socket_perms; ++ ++libs_use_ld_so(gcl_t) ++libs_use_shared_libs(gcl_t) ++ ++miscfiles_read_localization(gcl_t) ++ ++## The GCL memory management and executable dumping routines manipulate memory ++## in various (usually forbidden) ways. ++allow gcl_t self:process { execmem execheap }; ++ ++optional_policy(` ++ unconfined_domain(gcl_t) ++') ++ ++optional_policy(` ++ gen_require(` ++ type unconfined_t; ++ type unconfined_devpts_t; ++ type unconfined_tty_device_t; ++ role unconfined_r; ++ ') ++ ++ gcl_run(unconfined_t, unconfined_r, { unconfined_tty_device_t unconfined_devpts_t }) ++ allow gcl_t gcl_exec_t:file execmod; ++') +diff -durpN gcl-2.6.12.ORIG/unixport/makefile gcl-2.6.12/unixport/makefile +--- gcl-2.6.12.ORIG/unixport/makefile 2014-10-23 15:29:00.000000000 -0600 ++++ gcl-2.6.12/unixport/makefile 2014-10-28 11:50:44.626943228 -0600 +@@ -128,6 +128,7 @@ saved_%:raw_% $(RSYM) init_%.lsp raw_%_m + echo " (in-package \"USER\")(system:save-system \"$@\")" >>foo + ar x lib$*.a $$(ar t lib$*.a |grep ^gcl_) + $(PORTDIR)/raw_$*$(EXE) $(PORTDIR)/ -libdir $(GCLDIR)/ < foo ++ chcon -t gcl_exec_t $@ || true + # check that saved image can be prelinked + [ "$(PRELINK_CHECK)" = "" ] || \ + ! [ -x /usr/bin/objdump ] || \ +@@ -174,6 +175,7 @@ ifeq ($(GNU_LD),1) + else + $(CC) $(LD_FLAGS) -o raw_$*$(EXE) $(filter %.o,$^) -L. $(EXTRA_LD_LIBS) $(LD_LIBS_PRE) -l$* $(LD_LIBS_POST) + endif ++ chcon -t gcl_exec_t raw_$*$(EXE) || true + # diff map_$* map_$*.old >/dev/null || (cp map_$* map_$*.old && rm -f $@ && $(MAKE) $@) + # cp map_$*.old map_$* + diff --git a/gcl-2.6.12-unrandomize.patch b/gcl-2.6.12-unrandomize.patch new file mode 100644 index 0000000..ceb0999 --- /dev/null +++ b/gcl-2.6.12-unrandomize.patch @@ -0,0 +1,421 @@ +--- ./configure.orig 2014-10-28 12:00:00.000000000 -0600 ++++ ./configure 2014-10-28 12:00:00.000000000 -0600 +@@ -7695,9 +7695,11 @@ else + + #include + #include ++ #define CAN_UNRANDOMIZE_SBRK 1 ++ #include "h/unrandomize.h" + void gprof_cleanup() {} + int main(int argc,char **argv,char **envp) { +- #include "h/unrandomize.h" ++ UNRANDOMIZE_SBRK; + return 0;} + _ACEOF + if ac_fn_c_try_run "$LINENO"; then : +@@ -7725,12 +7727,11 @@ else + + #include + #include ++ #include "h/unrandomize.h" + void gprof_cleanup() {} + int main(int argc,char * argv[],char * envp[]) { + FILE *f; +- #ifdef CAN_UNRANDOMIZE_SBRK +- #include "h/unrandomize.h" +- #endif ++ UNRANDOMIZE_SBRK; + if (!(f=fopen("conftest1","w"))) return -1; + fprintf(f,"%u",sbrk(0)); + return 0;} +@@ -7755,12 +7756,11 @@ else + + #include + #include ++ #include "h/unrandomize.h" + void gprof_cleanup() {} + int main(int argc,char * argv[],char * envp[]) { + FILE *f; +- #ifdef CAN_UNRANDOMIZE_SBRK +- #include "h/unrandomize.h" +- #endif ++ UNRANDOMIZE_SBRK; + if (!(f=fopen("conftest1","w"))) return -1; + fprintf(f,"%u",sbrk(0)); + return 0;} +@@ -7814,6 +7814,7 @@ else + + #include + #include ++ #include "h/unrandomize.h" + void * + foo() { + int i; +@@ -7826,9 +7827,7 @@ else + FILE *fp = fopen("conftest1","w"); + unsigned long i,j; + +- #ifdef CAN_UNRANDOMIZE_SBRK +- #include "h/unrandomize.h" +- #endif ++ UNRANDOMIZE_SBRK; + j=1; + j<<=$PAGEWIDTH; + j<<=16; +@@ -7872,6 +7871,7 @@ else + + #include + #include ++ #include "h/unrandomize.h" + void * + foo() { + int i; +@@ -7884,9 +7884,7 @@ else + FILE *fp = fopen("conftest1","w"); + unsigned long i,j; + +- #ifdef CAN_UNRANDOMIZE_SBRK +- #include "h/unrandomize.h" +- #endif ++ UNRANDOMIZE_SBRK; + j=1; + j<<=$PAGEWIDTH; + j<<=16; +@@ -7931,11 +7929,10 @@ else + + #include + #include ++ #include "h/unrandomize.h" + void gprof_cleanup() {} + int main(int argc,char **argv,char **envp) { +- #ifdef CAN_UNRANDOMIZE_SBRK +- #include "h/unrandomize.h" +- #endif ++ UNRANDOMIZE_SBRK; + return (long)$cstack_address<0 ? 0 : -1; + } + _ACEOF +@@ -7970,14 +7967,13 @@ else + + #include + #include ++ #include "h/unrandomize.h" + void gprof_cleanup() {} + int main(int argc,char **argv,char **envp) { + void *b,*c; + FILE *fp = fopen("conftest1","w"); + long n; +- #ifdef CAN_UNRANDOMIZE_SBRK +- #include "h/unrandomize.h" +- #endif ++ UNRANDOMIZE_SBRK; + b=alloca(sizeof(b)); + c=alloca(sizeof(c)); + n=b>c ? b-c : c-b; +@@ -8017,6 +8013,7 @@ else + + #include + #include ++ #include "h/unrandomize.h" + void * + foo(void) { + int i; +@@ -8027,9 +8024,7 @@ else + int main(int argc,char **argv,char **envp) { + char *b; + FILE *fp = fopen("conftest1","w"); +- #ifdef CAN_UNRANDOMIZE_SBRK +- #include "h/unrandomize.h" +- #endif ++ UNRANDOMIZE_SBRK; + fprintf(fp,"%d",((long) &b) > ((long) foo()) ? -1 : 1); + fclose(fp); + return 0; +--- ./configure.in.orig 2014-10-28 12:00:00.000000000 -0600 ++++ ./configure.in 2014-10-28 12:00:00.000000000 -0600 +@@ -1435,9 +1435,11 @@ if test "$HAVE_SBRK" = "1" ; then + AC_LANG_SOURCE([[ + #include + #include ++ #define CAN_UNRANDOMIZE_SBRK 1 ++ #include "h/unrandomize.h" + void gprof_cleanup() {} + int main(int argc,char **argv,char **envp) { +- #include "h/unrandomize.h" ++ UNRANDOMIZE_SBRK; + return 0;}]])], + [AC_MSG_RESULT(yes) + AC_DEFINE(CAN_UNRANDOMIZE_SBRK,1,[can prevent sbrk from returning random values])], +@@ -1447,12 +1449,11 @@ if test "$HAVE_SBRK" = "1" ; then + AC_RUN_IFELSE([AC_LANG_SOURCE([[ + #include + #include ++ #include "h/unrandomize.h" + void gprof_cleanup() {} + int main(int argc,char * argv[],char * envp[]) { + FILE *f; +- #ifdef CAN_UNRANDOMIZE_SBRK +- #include "h/unrandomize.h" +- #endif ++ UNRANDOMIZE_SBRK; + if (!(f=fopen("conftest1","w"))) return -1; + fprintf(f,"%u",sbrk(0)); + return 0;}]])],SBRK=`cat conftest1`,SBRK=0,SBRK=0) +@@ -1462,12 +1463,11 @@ if test "$HAVE_SBRK" = "1" ; then + AC_RUN_IFELSE([AC_LANG_SOURCE([[ + #include + #include ++ #include "h/unrandomize.h" + void gprof_cleanup() {} + int main(int argc,char * argv[],char * envp[]) { + FILE *f; +- #ifdef CAN_UNRANDOMIZE_SBRK +- #include "h/unrandomize.h" +- #endif ++ UNRANDOMIZE_SBRK; + if (!(f=fopen("conftest1","w"))) return -1; + fprintf(f,"%u",sbrk(0)); + return 0;}]])],SBRK1=`cat conftest1`,SBRK1=0,SBRK1=0) +@@ -1539,6 +1539,7 @@ AC_MSG_CHECKING(CSTACK_ADDRESS) + AC_RUN_IFELSE([AC_LANG_SOURCE([[ + #include + #include ++ #include "h/unrandomize.h" + void * + foo() { + int i; +@@ -1551,9 +1552,7 @@ AC_RUN_IFELSE([AC_LANG_SOURCE([[ + FILE *fp = fopen("conftest1","w"); + unsigned long i,j; + +- #ifdef CAN_UNRANDOMIZE_SBRK +- #include "h/unrandomize.h" +- #endif ++ UNRANDOMIZE_SBRK; + j=1; + j<<=$PAGEWIDTH; + j<<=16; +@@ -1573,6 +1572,7 @@ AC_MSG_CHECKING([cstack bits]) + AC_RUN_IFELSE([AC_LANG_SOURCE([[ + #include + #include ++ #include "h/unrandomize.h" + void * + foo() { + int i; +@@ -1585,9 +1585,7 @@ AC_RUN_IFELSE([AC_LANG_SOURCE([[ + FILE *fp = fopen("conftest1","w"); + unsigned long i,j; + +- #ifdef CAN_UNRANDOMIZE_SBRK +- #include "h/unrandomize.h" +- #endif ++ UNRANDOMIZE_SBRK; + j=1; + j<<=$PAGEWIDTH; + j<<=16; +@@ -1608,11 +1606,10 @@ AC_MSG_CHECKING(NEG_CSTACK_ADDRESS) + AC_RUN_IFELSE([AC_LANG_SOURCE([[ + #include + #include ++ #include "h/unrandomize.h" + void gprof_cleanup() {} + int main(int argc,char **argv,char **envp) { +- #ifdef CAN_UNRANDOMIZE_SBRK +- #include "h/unrandomize.h" +- #endif ++ UNRANDOMIZE_SBRK; + return (long)$cstack_address<0 ? 0 : -1; + }]])],[AC_MSG_RESULT(yes) + neg_cstack_address=1 +@@ -1625,14 +1622,13 @@ AC_MSG_CHECKING([finding CSTACK_ALIGNMEN + AC_RUN_IFELSE([AC_LANG_SOURCE([[ + #include + #include ++ #include "h/unrandomize.h" + void gprof_cleanup() {} + int main(int argc,char **argv,char **envp) { + void *b,*c; + FILE *fp = fopen("conftest1","w"); + long n; +- #ifdef CAN_UNRANDOMIZE_SBRK +- #include "h/unrandomize.h" +- #endif ++ UNRANDOMIZE_SBRK; + b=alloca(sizeof(b)); + c=alloca(sizeof(c)); + n=b>c ? b-c : c-b; +@@ -1648,6 +1644,7 @@ AC_MSG_CHECKING(CSTACK_DIRECTION) + AC_RUN_IFELSE([AC_LANG_SOURCE([[ + #include + #include ++ #include "h/unrandomize.h" + void * + foo(void) { + int i; +@@ -1658,9 +1655,7 @@ AC_RUN_IFELSE([AC_LANG_SOURCE([[ + int main(int argc,char **argv,char **envp) { + char *b; + FILE *fp = fopen("conftest1","w"); +- #ifdef CAN_UNRANDOMIZE_SBRK +- #include "h/unrandomize.h" +- #endif ++ UNRANDOMIZE_SBRK; + fprintf(fp,"%d",((long) &b) > ((long) foo()) ? -1 : 1); + fclose(fp); + return 0; +--- ./h/unrandomize.h.orig 2014-10-23 15:29:00.000000000 -0600 ++++ ./h/unrandomize.h 2014-10-28 12:00:00.000000000 -0600 +@@ -1,3 +1,5 @@ ++#include ++#include + #include + #include + #include +@@ -5,61 +7,66 @@ + #include + #include + +-{ +- errno=0; +- +- { +- +- /*READ_IMPLIES_EXEC is for selinux, but selinux will reset it in the child*/ +- long pers = personality(READ_IMPLIES_EXEC|personality(0xffffffffUL)); +- long flag = ADDR_NO_RANDOMIZE; +- +- if (sizeof(long)==4) flag|=ADDR_LIMIT_3GB|ADDR_COMPAT_LAYOUT; +- +- if (pers==-1) {printf("personality failure %d\n",errno);exit(-1);} +- if ((pers & flag)!=flag && !getenv("GCL_UNRANDOMIZE")) { +- errno=0; +- if (personality(pers | flag) != -1 && (personality(0xffffffffUL) & flag)==flag) { +- int i,j,k; +- char **n,**a; +- void *v; +- for (i=j=0;argv[i];i++) +- j+=strlen(argv[i])+1; +- for (k=0;envp[k];k++) +- j+=strlen(envp[k])+1; +- j+=(i+k+3)*sizeof(char *); +- if ((v=sbrk(j))==(void *)-1) { +- printf("Cannot brk environment space\n"); +- exit(-1); +- } +- a=v; +- v=a+i+1; +- n=v; +- v=n+k+2; +- for (i=0;argv[i];i++) { +- a[i]=v; +- strcpy(v,argv[i]); +- v+=strlen(v)+1; +- } +- a[i]=0; +- for (k=0;envp[k];k++) { +- n[k]=v; +- strcpy(v,envp[k]); +- v+=strlen(v)+1; +- } +- n[k]="GCL_UNRANDOMIZE=t"; +- n[k+1]=0; +-#ifdef GCL_GPROF +- gprof_cleanup(); ++#ifdef CAN_UNRANDOMIZE_SBRK ++# ifdef GCL_GPROF ++# define GPROF_CLEANUP gprof_cleanup() ++# else ++# define GPROF_CLEANUP ++# endif ++# define UNRANDOMIZE_SBRK do { \ ++ errno=0; \ ++ { \ ++ /*READ_IMPLIES_EXEC is for selinux, but selinux will reset it in the child*/ \ ++ long pers = personality(0xffffffffUL); \ ++ long flag = ADDR_NO_RANDOMIZE; \ ++ \ ++ if (sizeof(long)==4) flag|=ADDR_LIMIT_3GB|ADDR_COMPAT_LAYOUT; \ ++ \ ++ if (pers==-1) {printf("personality failure %d\n",errno);exit(-1);} \ ++ if ((pers & flag)!=flag && !getenv("GCL_UNRANDOMIZE")) { \ ++ errno=0; \ ++ if (personality(pers | flag) != -1 && (personality(0xffffffffUL) & flag)==flag) { \ ++ int i,j,k; \ ++ char **n,**a; \ ++ void *v; \ ++ for (i=j=0;argv[i];i++) \ ++ j+=strlen(argv[i])+1; \ ++ for (k=0;envp[k];k++) \ ++ j+=strlen(envp[k])+1; \ ++ j+=(i+k+3)*sizeof(char *); \ ++ if ((v=sbrk(j))==(void *)-1) { \ ++ printf("Cannot brk environment space\n"); \ ++ exit(-1); \ ++ } \ ++ a=v; \ ++ v=a+i+1; \ ++ n=v; \ ++ v=n+k+2; \ ++ for (i=0;argv[i];i++) { \ ++ a[i]=v; \ ++ strcpy(v,argv[i]); \ ++ v+=strlen(v)+1; \ ++ } \ ++ a[i]=0; \ ++ for (k=0;envp[k];k++) { \ ++ n[k]=v; \ ++ strcpy(v,envp[k]); \ ++ v+=strlen(v)+1; \ ++ } \ ++ n[k]="GCL_UNRANDOMIZE=t"; \ ++ n[k+1]=0; \ ++ GPROF_CLEANUP; \ ++ errno=0; \ ++ execve(*a,a,n); \ ++ printf("execve failure %d\n",errno); \ ++ exit(-1); \ ++ } else { \ ++ printf("personality change failure %d\n",errno); \ ++ exit(-1); \ ++ } \ ++ } \ ++ } \ ++} while (0) ++#else ++# define UNRANDOMIZE_SBRK + #endif +- errno=0; +- execve(*a,a,n); +- printf("execve failure %d\n",errno); +- exit(-1); +- } else { +- printf("personality change failure %d\n",errno); +- exit(-1); +- } +- } +- } +-} +--- ./o/main.c.orig 2014-10-23 15:29:00.000000000 -0600 ++++ ./o/main.c 2014-10-28 12:00:00.000000000 -0600 +@@ -50,6 +50,7 @@ void initialize_process(); + #include "include.h" + #include + #include "page.h" ++#include "unrandomize.h" + + bool saving_system=FALSE; + +@@ -370,11 +371,7 @@ main(int argc, char **argv, char **envp) + #endif + *argv=kcl_self; + +-#ifdef CAN_UNRANDOMIZE_SBRK +-#include +-#include +-#include "unrandomize.h" +-#endif ++ UNRANDOMIZE_SBRK; + + #ifdef LD_BIND_NOW + #include diff --git a/gcl.spec b/gcl.spec index b93efa1..d0db061 100644 --- a/gcl.spec +++ b/gcl.spec @@ -2,8 +2,8 @@ %global __global_cflags %__global_cflags -fno-omit-frame-pointer Name: gcl -Version: 2.6.11 -Release: 3%{?dist} +Version: 2.6.12 +Release: 1%{?dist} Summary: GNU Common Lisp Group: Development/Languages @@ -17,7 +17,7 @@ Source1: gcl.el Source2: %{name}-2.6.8-info.tar.xz # This patch was last sent upstream on 29 Dec 2008. It fixes a file descriptor # leak, as well as combining 4 system calls into only 2 on an exec(). -Patch0: %{name}-2.6.11-fd-leak.patch +Patch0: %{name}-2.6.12-fd-leak.patch # This patch was last sent upstream on 29 Dec 2008. It updates one source file # from LaTeX 2.09 to LaTeX 2e, thereby eliminating LaTeX warnings about running # in compatibility mode. @@ -29,7 +29,7 @@ Patch2: %{name}-2.6.11-texinfo.patch Patch3: %{name}-2.6.11-elisp.patch # This patch was last sent upstream on 17 Jan 2009. It adds support for # compiling and running on an SELinux-enabled host. -Patch4: %{name}-2.6.11-selinux.patch +Patch4: %{name}-2.6.12-selinux.patch # This patch was last sent upstream on 29 Dec 2008. It uses the rename() # system call when it is available to avoid spawning a subshell and suffering a # context switch just to rename a file. @@ -47,36 +47,29 @@ Patch8: %{name}-2.6.11-plt.patch # This patch was last sent upstream on 13 Oct 2009. It fixes several malformed # function prototypes involving an ellipsis. Patch9: %{name}-2.6.11-ellipsis.patch -# This patch was last sent upstream on 30 Oct 2012. It provides more -# information when an unknown reloc type is encountered. -Patch10: %{name}-2.6.11-reloc-type.patch # This patch was last sent upstream on 29 Dec 2008. It updates the autoconf # and libtool files to newer versions. By itself, this patch accomplishes # little of interest. However, some of the later patches change configure.in. # Without this patch, autoconf appears to run successfully, but generates a # configure script that contains invalid shell script syntax. -Patch11: %{name}-2.6.11-infrastructure.patch +Patch10: %{name}-2.6.11-infrastructure.patch # This patch was last sent upstream on 29 Dec 2008. It rationalizes the # handling of system extensions. For example, on glibc-based systems, some # functionality is available only when _GNU_SOURCE is defined. -Patch12: %{name}-2.6.11-extension.patch +Patch11: %{name}-2.6.11-extension.patch # This patch was last sent upstream on 29 Dec 2008. It fixes a compilation # error on newer GCC systems due to an include inside a function. This affects # the "unrandomize" sbrk() functionality, hence the name of the patch. -Patch13: %{name}-2.6.11-unrandomize.patch +Patch12: %{name}-2.6.12-unrandomize.patch # The need for this patch was last communicated to upstream on 21 May 2009. # Without this patch, compilation fails due to conflicting type definitions # between glibc and Linux kernel headers. This patch prevents the kernel # headers from being used. -Patch14: %{name}-2.6.11-asm-signal-h.patch +Patch13: %{name}-2.6.11-asm-signal-h.patch # This patch is still experimental. Enable large file support. -Patch15: %{name}-2.6.11-largefile.patch +Patch14: %{name}-2.6.12-largefile.patch # Fix a linker problem on ARM platforms. -Patch16: %{name}-2.6.11-arm.patch -# Support R_PPC64_REL32 relocations on ppc64/ppc64le -Patch17: %{name}-2.6.11-ppc64.patch -# Support R_AARCH64_PREL{16,32,64} relocations on aarch64 -Patch18: %{name}-2.6.11-aarch64.patch +Patch15: %{name}-2.6.11-arm.patch BuildRequires: libXaw-devel BuildRequires: readline-devel @@ -175,9 +168,6 @@ gcl_exec_t. %patch13 %patch14 %patch15 -%patch16 -%patch17 -%patch18 # Ensure the frame pointer doesn't get added back sed -i 's/"-fomit-frame-pointer"/""/' configure @@ -336,6 +326,10 @@ fi %changelog +* Tue Oct 28 2014 Jerry James - 2.6.12-1 +- New upstream release +- Drop upstreamed reloc patches + * Fri Oct 10 2014 Jerry James - 2.6.11-3 - Add -aarch64 patch to fix build on aarch64 - Update -ppc64 patch to match upstream's version diff --git a/sources b/sources index ac8e64a..7ecf48e 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -72d505068d999ddd5c70e846bd7c5156 gcl-2.6.11.tar.gz +d7a0aee800f19b6cbc5cf7eec9e0f605 gcl-2.6.12.tar.gz b965d4ea561a9c3e019c65be69fcfb1e gcl-2.6.8-info.tar.xz