]> git.ipfire.org Git - thirdparty/gcc.git/commit
PR modula2/116378 m2 bootstrap fails on x86_64-darwin
authorGaius Mulley <gaiusmod2@gmail.com>
Fri, 16 Aug 2024 11:41:11 +0000 (12:41 +0100)
committerGaius Mulley <gaiusmod2@gmail.com>
Fri, 16 Aug 2024 11:41:11 +0000 (12:41 +0100)
commit9cdde72d1cefdf2ffff52ad2eec1ff465dccb3ab
tree8ad254373721a44066808e7095c9d0563819a98f
parent2f90f3850eaf9d703d9eb63d5f0347158aa11027
PR modula2/116378 m2 bootstrap fails on x86_64-darwin

This patch fixes m2 bootstrap failure on x86_64-darwin.  libc_open
is defined with three parameters the last of which is an int for
portability (rather than a vararg).  This avoids portability
problems by promoting mode_t to an int.  In the future it could
be tidied up by using the m2 optarg extension.

gcc/m2/ChangeLog:

PR modula2/116378
* gm2-libs-iso/TermFile.mod (termOpen): Add third argument
for open.
* gm2-libs/libc.def (open): Remove vararg and use INTEGER for
mode parameter three.
* mc-boot-ch/Glibc.c (tracedb_open): Replace mode_t with int.
(libc_open): Rewrite without varargs.
* mc-boot/Glibc.h (libc_open): Replace varargs with int mode.
* pge-boot/Glibc.cc (libc_open): Rewrite.
* pge-boot/Glibc.h (libc_open): Replace varargs with int mode.

gcc/testsuite/ChangeLog:

PR modula2/116378
* gm2/extensions/run/pass/testopen.mod: Add third argument
for open.
* gm2/isolib/run/pass/openlibc.mod: Ditto.
* gm2/pim/run/pass/testaddr3.mod: Ditto.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
gcc/m2/gm2-libs-iso/TermFile.mod
gcc/m2/gm2-libs/libc.def
gcc/m2/mc-boot-ch/Glibc.c
gcc/m2/mc-boot/Glibc.h
gcc/m2/pge-boot/Glibc.cc
gcc/m2/pge-boot/Glibc.h
gcc/testsuite/gm2/extensions/run/pass/testopen.mod
gcc/testsuite/gm2/isolib/run/pass/openlibc.mod
gcc/testsuite/gm2/pim/run/pass/testaddr3.mod