Skip to content

Commit

Permalink
shells/ksh*: Permanently fix LLVM15 build
Browse files Browse the repository at this point in the history
Fix aso atomics broken by LLVM:

/wrkdirs/usr/ports/shells/ksh/work/ksh-1.0.4/src/lib/libast/aso/aso.c
/wrkdirs/usr/ports/shells/ksh/work/ksh-1.0.4/src/lib/libast/aso/aso.c:839:10: error: incompatible integer to pointer conversion passing 'uint64_t' (aka 'unsigned long') to parameter of type 'void *' [-Wint-conversion]
                return _aso_casptr((void**)p, o, n);
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
./FEATURE/aso:19:66: note: expanded from macro '_aso_casptr'
                                                                      ^~~~~~~~~~~
/wrkdirs/usr/ports/shells/ksh/work/ksh-1.0.4/src/lib/libast/aso/aso.c:839:10: error: incompatible integer to pointer conversion passing 'uint64_t' (aka 'unsigned long') to parameter of type 'void *' [-Wint-conversion]
                return _aso_casptr((void**)p, o, n);
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
./FEATURE/aso:19:78: note: expanded from macro '_aso_casptr'
                                                                                  ^~~~~~~~~~~
2 errors generated.
mamake [lib/libast]: *** exit code 1 making aso.o
mamake: *** exit code 1 making lib/libast
mamake: *** exit code 1 making all
package: creating flat view
package: make failed at Fri Feb 10 06:00:01 UTC 2023 in /wrkdirs/usr/ports/shells/ksh/work/ksh-1.0.4/arch/freebsd14.amd64-64
*** Error code 1
  • Loading branch information
cschuber committed Feb 15, 2023
1 parent d74ee97 commit 38557f2
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 2 deletions.
2 changes: 1 addition & 1 deletion shells/ksh-devel/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ KSH93D_DESC= Install to ${PREFIX}/bin/ksh93d (development)

CFLAGS+= -DMAP_TYPE
LDFLAGS+= -lm
MAKE_ENV= CCFLAGS="-Wno-unused-value -Wno-parentheses -Wno-logical-op-parentheses -Wno-int-conversion" CFLAGS="${CFLAGS}"
MAKE_ENV= CCFLAGS="-Wno-unused-value -Wno-parentheses -Wno-logical-op-parentheses" CFLAGS="${CFLAGS}"

STATIC_MAKE_ENV= LDFLAGS+=-static

Expand Down
11 changes: 11 additions & 0 deletions shells/ksh-devel/files/patch-src_lib_libast_aso_aso.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- src/lib/libast/aso/aso.c.orig 2023-01-11 01:32:04.000000000 -0800
+++ src/lib/libast/aso/aso.c 2023-02-15 06:41:07.380213000 -0800
@@ -836,7 +836,7 @@

#if defined(_aso_casptr)
if (!state.lockf)
- return _aso_casptr((void**)p, o, n);
+ return _aso_cas64((void**)p, o, n);
#endif
k = lock(state.data, 0, p);
if (*(void* volatile*)p == o)
2 changes: 1 addition & 1 deletion shells/ksh/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ KSH93N_DESC= Install to ${PREFIX}/bin/ksh93n (new)

CFLAGS+= -DMAP_TYPE
LDFLAGS+= -lm
MAKE_ENV= CCFLAGS="-Wno-unused-value -Wno-parentheses -Wno-logical-op-parentheses -Wno-int-conversion" CFLAGS="${CFLAGS}"
MAKE_ENV= CCFLAGS="-Wno-unused-value -Wno-parentheses -Wno-logical-op-parentheses" CFLAGS="${CFLAGS}"

STATIC_MAKE_ENV= LDFLAGS+=-static

Expand Down
11 changes: 11 additions & 0 deletions shells/ksh/files/patch-src_lib_libast_aso_aso.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- src/lib/libast/aso/aso.c.orig 2022-10-21 20:05:14.000000000 -0700
+++ src/lib/libast/aso/aso.c 2023-02-15 06:39:08.156515000 -0800
@@ -836,7 +836,7 @@

#if defined(_aso_casptr)
if (!state.lockf)
- return _aso_casptr((void**)p, o, n);
+ return _aso_cas64((void**)p, o, n);
#endif
k = lock(state.data, 0, p);
if (*(void* volatile*)p == o)

0 comments on commit 38557f2

Please sign in to comment.