Skip to content

Commit

Permalink
Merge branch 'master' into fix_x390
Browse files Browse the repository at this point in the history
  • Loading branch information
k-okada authored Dec 11, 2024
2 parents 7cca3cf + 1c377de commit fb7f44a
Show file tree
Hide file tree
Showing 12 changed files with 96 additions and 38 deletions.
14 changes: 9 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@ references:
run:
name: Setup TeX
command: |-
export DEBIAN_FRONTEND=noninteractive
sudo apt-get update
sudo apt-get install -qq -y texlive-latex-base texlive-binaries texlive-lang-japanese latex2html nkf poppler-utils
setup-eus: &setup-eus
run:
name: Setup EusLisp
command: |-
export DEBIAN_FRONTEND=noninteractive
sudo apt-get install -qq -y git make gcc g++ libjpeg-dev libxext-dev libx11-dev libgl1-mesa-dev libglu1-mesa-dev libpq-dev libpng-dev xfonts-100dpi xfonts-75dpi
echo 'export EUSDIR=`pwd`' >> $BASH_ENV
echo 'export ARCHDIR=Linux64' >> $BASH_ENV
Expand All @@ -25,7 +27,7 @@ references:
jobs:
html:
machine:
image: ubuntu-2004:2022.07.1
image: default
steps:
- checkout
- *setup-tex
Expand Down Expand Up @@ -55,7 +57,7 @@ jobs:

latex:
machine:
image: ubuntu-2004:2022.07.1
image: default
steps:
- checkout
- *setup-tex
Expand All @@ -76,7 +78,7 @@ jobs:
paths: manual.pdf
jlatex:
machine:
image: ubuntu-2004:2022.07.1
image: default
steps:
- checkout
- *setup-tex
Expand All @@ -97,13 +99,15 @@ jobs:
paths: jmanual.pdf
rst:
machine:
image: ubuntu-2004:2022.07.1
image: default
steps:
- checkout
- *setup-tex
- run:
name: Install Pandoc
command: sudo apt-get install -y -qq pandoc
command: |
export DEBIAN_FRONTEND=noninteractive
sudo apt-get install -y -qq pandoc
- run:
name: Compile reStructuredText(reST)
command: cd doc/latex && make rst
Expand Down
43 changes: 34 additions & 9 deletions .github/workflows/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
ROS_DISTRO: noetic
- DOCKER_IMAGE: osrf/ubuntu_armhf:trusty
- DOCKER_IMAGE: osrf/ubuntu_armhf:xenial
- DOCKER_IMAGE: osrf/ubuntu_arm64:trusty
# - DOCKER_IMAGE: osrf/ubuntu_arm64:trusty # deprecated
- DOCKER_IMAGE: osrf/ubuntu_arm64:xenial
- QEMU: aarch64
DOCKER_IMAGE: arm64v8/ubuntu:bionic
Expand All @@ -53,7 +53,7 @@ jobs:
# ia64
# m68k
- QEMU: mips64el
DOCKER_IMAGE: loongnix/debian:buster # mips64el
DOCKER_IMAGE: loongnix/debian:buster # --platform is mips64le but qemu is mips64el
# mipsel
# - QEMU: ppc
# DOCKER_IMAGE: vicamo/debian:unstable-powerpc # powerpc / somehow failing loading eusgl
Expand Down Expand Up @@ -89,19 +89,30 @@ jobs:
if [[ "$QEMU" != "" ]]; then docker run --rm --privileged multiarch/qemu-user-static:register --reset; fi
if [[ "$DOCKER_IMAGE" == *"arm"* ]]; then sudo apt-get install -y -qq qemu-user-static; fi
if [[ "$DOCKER_IMAGE" == *"arm"* ]]; then git clone http://github.com/euslisp/jskeus ${HOME}/jskeus; fi
if [[ "$QEMU" != "" ]]; then export PLATFORM_OPTION="--platform linux/$QEMU"; fi
if [[ "$QEMU" == "mips64el" ]]; then export PLATFORM_OPTION="--platform linux/mips64le"; fi
echo "Testing branch $TRAVIS_BRANCH of $REPOSITORY_NAME on $QEMU_VOLUME"
docker run --rm $QEMU_VOLUME -v $HOME:$HOME -e "QEMU=$QEMU" -e "TRAVIS_OS_NAME=$TRAVIS_OS_NAME" -e "CI_SOURCE_PATH=$CI_SOURCE_PATH" -e "HOME=$HOME" -e "MAKEFLAGS=$MAKEFLAGS" -e "DOCKER_IMAGE=$DOCKER_IMAGE" -t $DOCKER_IMAGE sh -c "cd $CI_SOURCE_PATH; ./.travis.sh"
docker run $PLATFORM_OPTION --rm $QEMU_VOLUME -v $HOME:$HOME -e "QEMU=$QEMU" -e "TRAVIS_OS_NAME=$TRAVIS_OS_NAME" -e "CI_SOURCE_PATH=$CI_SOURCE_PATH" -e "HOME=$HOME" -e "MAKEFLAGS=$MAKEFLAGS" -e "DOCKER_IMAGE=$DOCKER_IMAGE" -t $DOCKER_IMAGE sh -c "cd $CI_SOURCE_PATH; ./.travis.sh"
debian-unstable:
strategy:
matrix:
include:
- DOCKER_IMAGE: amd64/debian:unstable-slim
DOCKER_PLATFORM: amd64
ARCH: Linux64
- DOCKER_IMAGE: arm32v7/debian:unstable-slim
DOCKER_PLATFORM: arm
ARCH: LinuxARM
- DOCKER_IMAGE: arm64v8/debian:unstable-slim
DOCKER_PLATFORM: aarch64
ARCH: LinuxARM
- DOCKER_IMAGE: s390x/debian:unstable-slim
DOCKER_PLATFORM: s390x
ARCH: Linux
- DOCKER_IMAGE: riscv64/debian:unstable-slim
DOCKER_PLATFORM: riscv64
ARCH: Linux

runs-on: ubuntu-latest
timeout-minutes: 60
Expand All @@ -119,14 +130,28 @@ jobs:
sudo apt update -qq
# Install the qemu packages
# This step will execute the registering scripts
if [[ "$DOCKER_IMAGE" == *"arm"* ]]; then \
sudo apt install -y -qq qemu binfmt-support qemu-user-static; \
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes; \
fi
docker run --rm -v $(pwd):/ws/euslisp -e "ARCH=$ARCH" -t "$DOCKER_IMAGE" bash -c "set -x; set -e; apt update -qq; apt install -y -qq make gcc libgl-dev libglu1-mesa-dev libjpeg-dev libpng-dev libpq-dev libx11-dev libxext-dev; ARCH=$ARCH EUSDIR=/ws/euslisp make -C /ws/euslisp/lisp/ -f Makefile.$ARCH eus0; CC='gcc -Werror' ARCHDIR=$ARCH EUSDIR=/ws/euslisp make -C /ws/euslisp/lisp/image/jpeg; exit 0"
sudo apt install -y -qq qemu binfmt-support qemu-user-static
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
docker run --rm --platform linux/${{matrix.DOCKER_PLATFORM}} -v $(pwd):/ws/euslisp -e "ARCH=$ARCH" -t "$DOCKER_IMAGE" \
bash -c " \
set -x; set -e; \
apt update -qq; \
apt install -y -qq make gcc libgl-dev libglu1-mesa-dev libjpeg-dev libpng-dev libpq-dev libx11-dev libxext-dev; \
CFLAGS='-Werror=implicit-function-declaration' ARCH=$ARCH EUSDIR=/ws/euslisp make -C /ws/euslisp/lisp/ -f Makefile.$ARCH eus0; \
CC='gcc -Werror' ARCHDIR=$ARCH EUSDIR=/ws/euslisp make -C /ws/euslisp/lisp/image/jpeg; \
if [[ "$DOCKER_IMAGE" == *"arm"* ]]; then exit 0; fi ; \
CFLAGS='-Werror=implicit-function-declaration' ARCH=$ARCH EUSDIR=/ws/euslisp make -C /ws/euslisp/lisp/ -f Makefile.$ARCH eus0 eus1 eus2 eusg eusx eusgl; \
apt install -y -qq curl dpkg-dev; \
curl -sLo /usr/local/bin/shunit2 https://raw.githubusercontent.com/kward/shunit2/master/shunit2; \
chmod +x /usr/local/bin/shunit2 ; \
export ARCHDIR=$ARCH; export EUSDIR=/ws/euslisp; export PATH=\$EUSDIR/\$ARCHDIR/bin:\$PATH; \
cd \$EUSDIR; \
curl -sLo euslisp-all-test https://salsa.debian.org/science-team/euslisp/-/raw/master/debian/tests/euslisp-all-test; \
bash ./euslisp-all-test; \
exit 0"
osx:
runs-on: macos-latest
runs-on: macos-13 # https://github.com/actions/runner-images/blob/main/images/macos/macos-13-Readme.md
timeout-minutes: 60
steps:
- name: Checkout
Expand Down
4 changes: 2 additions & 2 deletions .travis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ if [[ "$QEMU" != "" ]]; then
git clone http://salsa.debian.org/science-team/euslisp /tmp/euslisp-dfsg
for file in $(cat /tmp/euslisp-dfsg/debian/patches/series); do
# skip patches already applied by https://github.com/euslisp/EusLisp/pull/482, https://github.com/euslisp/EusLisp/pull/511
[[ $file =~ use-rtld-global-loadelf.patch|fix-arm-ldflags.patch|fix-library-not-linked-against-libc.patch|fix-manpage-has-bad-whatis-entry-on-man-pages.patch|fix-jpegmemcd-compile-error.patch|install-bin-lib-man-to-destdir.patch|install-eusjpeg-lib.patch ]] && continue;
# skip patch already applied by https://github.com/euslisp/EusLisp/pull/441, https://github.com/euslisp/EusLisp/pull/509
[[ $file =~ use-rtld-global-loadelf.patch|fix-arm-ldflags.patch|fix-library-not-linked-against-libc.patch|fix-manpage-has-bad-whatis-entry-on-man-pages.patch|fix-jpegmemcd-compile-error.patch|install-bin-lib-man-to-destdir.patch|install-eusjpeg-lib.patch|fix-lintian-typo.patch|fix-makefile-linux-MACHINE.patch ]] && continue;
# skip patch already applied by https://github.com/euslisp/EusLisp/pull/441, https://github.com/euslisp/EusLisp/pull/509, https://github.com/euslisp/EusLisp/pull/512, https://github.com/euslisp/EusLisp/pull/514
if [[ $file =~ fix-for-reprotest.patch ]]; then
filterdiff -p1 -x 'lisp/image/jpeg/makefile' -x 'lisp/comp/comp.l' < /tmp/euslisp-dfsg/debian/patches/$file > /tmp/euslisp-dfsg/debian/patches/$file-fix
file=$file-fix
Expand Down
6 changes: 6 additions & 0 deletions lisp/c/eus.c
Original file line number Diff line number Diff line change
Expand Up @@ -950,6 +950,12 @@ static void initfeatures()
#endif
#if aarch64
p=cons(ctx,intern(ctx,"AARCH64",7,keywordpkg),p);
#endif
#if s390x
p=cons(ctx,intern(ctx,"S390X",5,keywordpkg),p);
#endif
#if riscv64
p=cons(ctx,intern(ctx,"RISCV64",7,keywordpkg),p);
#endif
{
char tmp[32];
Expand Down
2 changes: 1 addition & 1 deletion lisp/c/eval.c
Original file line number Diff line number Diff line change
Expand Up @@ -1251,7 +1251,7 @@ pointer args[];

if (code->c.fcode.entry2 != NIL) {
#if (WORD_SIZE == 64)
ifunc = (((eusinteger_t)ifunc)&0xffffffff00000000) | (intval(code->c.fcode.entry2)&0x00000000ffffffff);
ifunc = (eusinteger_t (*)())((((eusinteger_t)ifunc)&0xffffffff00000000) | (intval(code->c.fcode.entry2)&0x00000000ffffffff));
#else
ifunc = (eusinteger_t (*)())((((int)ifunc)&0xffff0000) | (intval(code->c.fcode.entry2)&0x0000ffff)); /* kanehiro's patch 2000.12.13 */
#endif
Expand Down
2 changes: 1 addition & 1 deletion lisp/c/reader.c
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ int subchar;
{ register int i=0,j,c,p,q;
pointer b;
eusinteger_t *bv,x;
char ch, buf[WORD_SIZE];
char ch, buf[WORD_SIZE+1];

ch=readch(f);
while (i<WORD_SIZE && isxdigit(ch)) { buf[i++] = ch; ch=readch(f);}
Expand Down
4 changes: 2 additions & 2 deletions lisp/c/sysfunc.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,10 @@ register pointer p;
#if Solaris2
if ((eusinteger_t)p<(eusinteger_t)_end) return(NULL);
#elif sun3 || sun4 || news || (i386 && (!Cygwin && !Darwin)) || alpha || mips /* Cygwin does not have edata */
if ((eusinteger_t)p<(eusinteger_t)edata) return(NULL);
if ((eusinteger_t)p<(eusinteger_t)edata) return((int)NULL);
#endif
#if sun4 || vax || i386
if ((&ctx->stack[0]<=p) && (p<= &ctx->stack[MAXSTACK])) return(NULL);
if (((pointer)(&ctx->stack[0])<=p) && (p<= (pointer)(&ctx->stack[MAXSTACK]))) return((int)NULL);
#endif
if (issymbol(p)) return((long int)NULL);
#if (WORD_SIZE == 64)
Expand Down
41 changes: 26 additions & 15 deletions lisp/tool/eustags.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ what you give them. Help stamp out software-hoarding! */

#include <stdio.h>
#include <ctype.h>
#include <string.h>
#include <stdlib.h>

/* Define the symbol ETAGS to make the program "etags",
which makes emacs-style tag tables by default.
Expand Down Expand Up @@ -204,12 +206,20 @@ void put_entries (NODE *node);

char *savestr();
char *savenstr ();
// char *rindex();
//char *index();
char *_rindex();
char *_index();
char *concat ();
void initbuffer ();
long readline ();

int total_size_of_entries ();
int PF_funcs ();
int xmalloc ();
int consider_token ();
int tail ();
int TEX_Token ();
int xrealloc ();

/* A `struct linebuffer' is a structure which holds a line of text.
`readline' reads a line from a stream into a linebuffer
and works regardless of the length of the line. */
Expand Down Expand Up @@ -241,7 +251,7 @@ system (buf)
#endif /* VMS */
#endif /* 0 */

main(ac,av)
int main(ac,av)
int ac;
char *av[];
{
Expand All @@ -265,7 +275,7 @@ main(ac,av)
eflag = 0;
#else
{
char *subname = rindex (progname, '/');
char *subname = _rindex (progname, '/');
if (subname++ == NULL)
subname = progname;
eflag = ! strcmp(subname, "ctags");
Expand Down Expand Up @@ -507,7 +517,7 @@ find_entries (file)
return;
}
curfile = savestr(file);
cp = rindex(file, '.');
cp = _rindex(file, '.');
/* .tex, .aux or .bbl implies LaTeX source code */
if (cp && (!strcmp (cp + 1, "tex") || !strcmp (cp + 1, "aux")
|| !strcmp (cp + 1, "bbl")))
Expand Down Expand Up @@ -590,13 +600,13 @@ pfnote (name, f, linestart, linelen, lno, cno)
/* Change name "main" to M<thisfilename>. */
if (!eflag && !xflag && !strcmp(name, "main"))
{
fp = rindex(curfile, '/');
fp = _rindex(curfile, '/');
if (fp == 0)
fp = curfile;
else
fp++;
altname = concat ("M", fp, "");
fp = rindex(altname, '.');
fp = _rindex(altname, '.');
if (fp && fp[2] == 0)
*fp = 0;
name = altname;
Expand Down Expand Up @@ -1178,6 +1188,7 @@ PF_funcs(fi)
return (pfcnt);
}

int
tail(cp)
char *cp;
{
Expand Down Expand Up @@ -1428,7 +1439,7 @@ TEX_funcs (fi)
charno += readline (&lb, fi) + 1;
dbp = lb.buffer;
lasthit = dbp;
while (dbp = index (dbp, TEX_esc)) /* Look at each escape in line */
while (dbp = _index (dbp, TEX_esc)) /* Look at each escape in line */
{
register int i;

Expand Down Expand Up @@ -1487,7 +1498,7 @@ TEX_decode_env (evarname, defenv)
char *defenv;
{
register char *env, *p;
extern char *savenstr (), *index ();
extern char *savenstr (), *_index ();

struct TEX_tabent *tab;
int size, i;
Expand All @@ -1501,15 +1512,15 @@ TEX_decode_env (evarname, defenv)

/* Allocate a token table */
for (size = 1, p=env; p;)
if ((p = index (p, ':')) && *(++p))
if ((p = _index (p, ':')) && *(++p))
size++;
tab = (struct TEX_tabent *) xmalloc (size * sizeof (struct TEX_tabent));

/* Unpack environment string into token table. Be careful about */
/* zero-length strings (leading ':', "::" and trailing ':') */
for (i = 0; *env;)
{
p = index (env, ':');
p = _index (env, ':');
if (!p) /* End of environment string. */
p = env + strlen (env);
if (p - env > 0)
Expand Down Expand Up @@ -1644,7 +1655,7 @@ savenstr(cp, len)
*/

char *
rindex(sp, c)
_rindex(sp, c)
char *sp, c;
{
char *r;
Expand All @@ -1666,7 +1677,7 @@ rindex(sp, c)
*/

char *
index(sp, c)
_index(sp, c)
register char *sp, c;
{
do
Expand Down Expand Up @@ -1722,7 +1733,7 @@ int
xmalloc (size)
int size;
{
int result = malloc (size);
int result = (int)malloc (size);
if (!result)
fatal ("virtual memory exhausted", 0);
return result;
Expand All @@ -1733,7 +1744,7 @@ xrealloc (ptr, size)
char *ptr;
int size;
{
int result = realloc (ptr, size);
int result = (int)realloc (ptr, size);
if (!result)
fatal ("virtual memory exhausted");
return result;
Expand Down
2 changes: 2 additions & 0 deletions lisp/xwindow/xforeign.c.c
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,8 @@ char *xentry;
#elif Darwin
eusinteger_t dlhandle;
dlhandle=(eusinteger_t)dlopen("/opt/X11/lib/libX11.dylib", RTLD_LAZY);
if( dlhandle==0 )
dlhandle=(eusinteger_t)dlopen("/usr/local/lib/libX11.dylib", RTLD_LAZY);
if( dlhandle==0 )
dlhandle=(eusinteger_t)dlopen("libX11.dylib", RTLD_LAZY);
entry=(eusinteger_t)dlsym(dlhandle, xentry);
Expand Down
6 changes: 3 additions & 3 deletions test/mathtest.l
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@

;; random
(assert (v= #i(123456 789012) *random-state*) "initial *random-state*")
#+(or :alpha :irix6 :word-size=64)
#+(and (or :alpha :irix6 :word-size=64) (not (or :s390x :riscv64)))
(progn
(assert (= 0 (random 10)) "random 10 (1)")
(assert (= 3 (random 10)) "random 10 (2)")
Expand All @@ -62,7 +62,7 @@
(assert (= 1 (random 10)) "random 10 (5)"))

(setq *random-state* #i(123456 789012))
#+(or :alpha :irix6 :word-size=64)
#+(and (or :alpha :irix6 :word-size=64) (not (or :s390x :riscv64)))
(progn
(assert (eps= 0.593532 (random 10.0) 0.01) "random 10.0 (1)")
(assert (eps= 3.59535 (random 10.0) 0.01) "random 10.0 (2)")
Expand All @@ -82,7 +82,7 @@
(assert (v= (make-random-state nil) #i(123456 789012)) "(make-random-state nil)")
(assert (v= (make-random-state #i(11111 22222)) #i(11111 22222)) "(make-random-state #i(11111 22222))")
(assert (not (v= (make-random-state t) #i(123456 789012))) "(make-random-state t)")
#+(or :alpha :irix6 :word-size=64)
#+(and (or :alpha :irix6 :word-size=64) (not (or :s390x :riscv64)))
(assert (= 0 (random 10 (make-random-state #i(123456 789012)))) "(random 10 (make-random-state #i(123456 789012)))")
#-(or :alpha :irix6 :word-size=64)
(assert (= 3 (random 10 (make-random-state #i(123456 789012)))) "(random 10 (make-random-state #i(123456 789012)))")
Expand Down
2 changes: 2 additions & 0 deletions test/object.l
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@
;;;

(setq i-max 200000)
#+(or :s390x :riscv64)
(setq i-max 200)

(deftest test-copy-object-integer
(setq vmrss-orig (elt (unix::getrusage 0) 2))
Expand Down
Loading

0 comments on commit fb7f44a

Please sign in to comment.