diff options
| author | thegeorg <[email protected]> | 2024-10-21 11:10:39 +0300 |
|---|---|---|
| committer | thegeorg <[email protected]> | 2024-10-21 11:22:50 +0300 |
| commit | 73a97f8c926a19e65e72d70448ffa34b7281f1bd (patch) | |
| tree | 533c635ff4f07a8c5a16c5822637ec63fca78a0e /contrib/tools/bison | |
| parent | 16802cd0532abd2c6e750aa8a3254ba12173c65a (diff) | |
Fix building contrib/tools/{bison,m4} with musl-libc
Also: put devstack_targets.inc under musl autocheck.
commit_hash:a824666c706272699d21127ad3d73694357f07ae
Diffstat (limited to 'contrib/tools/bison')
| -rw-r--r-- | contrib/tools/bison/.yandex_meta/__init__.py | 29 | ||||
| -rw-r--r-- | contrib/tools/bison/lib/config-musl.h | 2 | ||||
| -rw-r--r-- | contrib/tools/bison/lib/ya.make | 15 |
3 files changed, 40 insertions, 6 deletions
diff --git a/contrib/tools/bison/.yandex_meta/__init__.py b/contrib/tools/bison/.yandex_meta/__init__.py index 52a66e95476..009d94080e5 100644 --- a/contrib/tools/bison/.yandex_meta/__init__.py +++ b/contrib/tools/bison/.yandex_meta/__init__.py @@ -55,6 +55,12 @@ WINDOWS_SRCS = [ "windows-tls.h", ] +MUSL_SRCS = [ + "error.c", + "obstack.c", + "obstack_printf.c", +] + DARWIN_SRCS = [ "error.c", "fpending.c", @@ -101,16 +107,31 @@ EXCESSIVE_SRCS = [ def post_install(self): with self.yamakes["lib"] as gnulib: + # musl-libc has fseterr + gnulib.SRCS.remove("fseterr.c") + gnulib.after( + "SRCS", + """ + IF (NOT MUSL) + SRCS( + fseterr.c + ) + ENDIF() + """, + ) gnulib.after( "SRCS", Switch( - OS_WINDOWS=Linkable( - SRCS=[src for src in WINDOWS_SRCS if pathutil.is_source(src)], - ADDINCL=[GLOBAL(f"{self.arcdir}/lib/platform/win64")], + MUSL=Linkable( + SRCS=MUSL_SRCS, ), OS_DARWIN=Linkable( SRCS=DARWIN_SRCS, ), + OS_WINDOWS=Linkable( + SRCS=[src for src in WINDOWS_SRCS if pathutil.is_source(src)], + ADDINCL=[GLOBAL(f"{self.arcdir}/lib/platform/win64")], + ), ), ) for src in WINDOWS_SRCS: @@ -162,7 +183,7 @@ bison = NixProject( "src/scan-skel.l", "src/parse-gram.y", ] - + [f"lib/{src}" for src in itertools.chain(WINDOWS_SRCS, DARWIN_SRCS)], + + [f"lib/{src}" for src in itertools.chain(MUSL_SRCS, DARWIN_SRCS, WINDOWS_SRCS)], copy_sources_except=[ # Don't need them for now, reduce import footprint "data/skeletons/d.m4", diff --git a/contrib/tools/bison/lib/config-musl.h b/contrib/tools/bison/lib/config-musl.h index d8ad04c19ef..41777d40f28 100644 --- a/contrib/tools/bison/lib/config-musl.h +++ b/contrib/tools/bison/lib/config-musl.h @@ -1,3 +1,5 @@ #define HAVE_SYS_TIMES_H 1 #define HAVE_STRUCT_TMS 1 #define HAVE_CLOCK_T 1 + +#define _GL_ARG_NONNULL(...) diff --git a/contrib/tools/bison/lib/ya.make b/contrib/tools/bison/lib/ya.make index da1aacbe5c7..38ca9b01203 100644 --- a/contrib/tools/bison/lib/ya.make +++ b/contrib/tools/bison/lib/ya.make @@ -60,7 +60,6 @@ SRCS( fd-safer-flag.c fd-safer.c fopen-safer.c - fseterr.c fstrcmp.c get-errno.c gethrxtime.c @@ -121,7 +120,19 @@ SRCS( xtime.c ) -IF (OS_DARWIN) +IF (NOT MUSL) + SRCS( + fseterr.c + ) +ENDIF() + +IF (MUSL) + SRCS( + error.c + obstack.c + obstack_printf.c + ) +ELSEIF (OS_DARWIN) SRCS( error.c fpending.c |
