Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for building with Zig #598

Closed
wants to merge 2 commits into from
Closed

Conversation

plajjan
Copy link
Contributor

@plajjan plajjan commented Dec 15, 2023

This adds a build.zig that allows building the garbage collector using the Zig build system. It implements a subset of the configuration options offered by CMake and following the naming convention in CMake for all those options.

There is a new GitHub Actions configuration file that runs a job that uses zig to compile the collector and targetting different targets using cross-compilation. It doesn't run any actual tests (and it should!).

The README is slightly updated, not just adding an explanation of zig but restructuring the whole section on how to build the GC somewhat. I moved mentions of libatomic_ops to a separate heading. All? modern compilers include atomic intrinsics so it feels like we don't have to include mentions of libatomic_ops in the default "how to build this" section but can mention it a little later. I tried to make it easier to read and more direct and to the point for new users. Let me know if you don't agree with this restructuring and I'll change back. I think there's more stuff to reword in the README but I don't want to focus too much on that in this PR since it's really about introducing zig.

The build.zig follows the format used in zig v0.12. The final 0.12 version is not out yet, so users will have to use a build from the zig master branch for now. This is not ideal but the whole zig build system is so new that there have been backwards incompatible changes from 0.11 which is why we opt to use 0.12 that is likely going to be closer to the final form.

@plajjan
Copy link
Contributor Author

plajjan commented Dec 15, 2023

@ivmai here's a first draft of adding in support for the zig build system. Please let me know what you think!? :)

@plajjan
Copy link
Contributor Author

plajjan commented Dec 15, 2023

I mean, there are things that are missing, like building dynamic libraries so I don't consider this ready for merge. I just wanted to get the current version out there to get feedback on the overall look and feel of it!

build.zig Outdated Show resolved Hide resolved
build.zig Outdated Show resolved Hide resolved
build.zig Outdated Show resolved Hide resolved
build.zig Outdated Show resolved Hide resolved
build.zig Outdated Show resolved Hide resolved
.github/workflows/zig-build.yml Outdated Show resolved Hide resolved
build.zig Outdated Show resolved Hide resolved
build.zig Show resolved Hide resolved
build.zig Outdated Show resolved Hide resolved
build.zig Outdated Show resolved Hide resolved
build.zig Show resolved Hide resolved
Copy link
Contributor Author

@plajjan plajjan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed most comments so far.

@plajjan
Copy link
Contributor Author

plajjan commented Dec 18, 2023

@ivmai so I've added in compilation and running of the basic gctest as well. It works when building a static lib and disabling threads:

kll@Boxy:~/terastream/acton-deps/bdwgc$ ~/terastream/acton/dist/zig/zig build -Dbuild_tests -Dbuild_shared_libs=false -Denable_threads=false test
Switched to incremental mode
Reading dirty bits from /proc
Completed 6 tests
Allocated 4154109 collectable objects
Allocated 1218 uncollectable objects
Allocated 8219232 atomic objects
Reallocated 756 objects
Garbage collection after fork is tested too
Finalized 13216/13216 objects - finalization is probably OK
Total number of bytes allocated is 1143245488
Total memory use by allocated blocks is 638976 bytes
Final heap size is 172032 bytes
Obtained 12488704 bytes from OS
Final number of reachable objects is 2423
Full/world-stopped collections took 23/484 ms
Completed 2475 collections
Collector appears to work
kll@Boxy:~/terastream/acton-deps/bdwgc$ 

If I enable threads, I get a failure:

kll@Boxy:~/terastream/acton-deps/bdwgc$ ~/terastream/acton/dist/zig/zig build -Dbuild_tests -Dbuild_shared_libs=false -Denable_threads=true test
Switched to incremental mode
Reading dirty bits from /proc
GC_is_visible produced wrong failure indication
Test failed
run gctest: error: the following command terminated unexpectedly:
/home/kll/terastream/acton-deps/bdwgc/zig-cache/o/71dd4f8899463605f4330d1f46afd9e6/gctest 
Build Summary: 19/21 steps succeeded; 1 failed (disable with --summary none)
test transitive failure
└─ run gctest failure
error: the following build command failed with exit code 1:
/home/kll/terastream/acton-deps/bdwgc/zig-cache/o/6ca84adc5567722c0e59ba2f7e1f9200/build /home/kll/terastream/acton/dist/zig/zig /home/kll/terastream/acton-deps/bdwgc /home/kll/terastream/acton-deps/bdwgc/zig-cache /home/kll/.cache/zig --seed 0x2b9282f8 -Dbuild_tests -Dbuild_shared_libs=false -Denable_threads=true test
kll@Boxy:~/terastream/acton-deps/bdwgc$

Similarly when building a shared lib also without threads, I get a different error:

kll@Boxy:~/terastream/acton-deps/bdwgc$ ~/terastream/acton/dist/zig/zig build -Dbuild_tests -Dbuild_shared_libs=true -Denable_threads=false test
Switched to incremental mode
Reading dirty bits from /proc
List reversal produced incorrect list - collector is broken
Test failed
run gctest: error: the following command terminated unexpectedly:
/home/kll/terastream/acton-deps/bdwgc/zig-cache/o/9285cc5d5ea49b5fec8b8149ebdb78e2/gctest 
Build Summary: 19/21 steps succeeded; 1 failed (disable with --summary none)
test transitive failure
└─ run gctest failure
error: the following build command failed with exit code 1:
/home/kll/terastream/acton-deps/bdwgc/zig-cache/o/6ca84adc5567722c0e59ba2f7e1f9200/build /home/kll/terastream/acton/dist/zig/zig /home/kll/terastream/acton-deps/bdwgc /home/kll/terastream/acton-deps/bdwgc/zig-cache /home/kll/.cache/zig --seed 0x72fd843e -Dbuild_tests -Dbuild_shared_libs=true -Denable_threads=false test
kll@Boxy:~/terastream/acton-deps/bdwgc$ 

When building with the equivalent options for CMake, the tests pass just fine. I've been trying to pin down where the compilation differs but haven't found anything so far. It could be that it's a difference due to zig default clang flags. I wonder if the error messages can guide to the error but I don't quite understand them, in particular the "GC_is_visible produced wrong failure indication". Could you possibly point me in the general direction where I should dig deeper?

I just pushed the latest code that fails as described above.

@plajjan
Copy link
Contributor Author

plajjan commented Dec 18, 2023

Nevermind, I found the cause. The flags were only applied to compilation of the lib, not of gctest itself and that discrepancy caused the failures. Having fixed that, I seem to be having some success with the tests. More to be reported!

build.zig Outdated Show resolved Hide resolved
build.zig Outdated Show resolved Hide resolved
build.zig Outdated Show resolved Hide resolved
build.zig Outdated Show resolved Hide resolved
@plajjan plajjan force-pushed the zig-build branch 9 times, most recently from 177780f to 04f3a1d Compare December 20, 2023 08:51
@ivmai
Copy link
Owner

ivmai commented Dec 20, 2023

I am reviewing the patch, I will commit some changes tomorrow.

@plajjan
Copy link
Contributor Author

plajjan commented Dec 20, 2023

@ivmai I'm seeing some intermittent test failures, like in https://github.com/ivmai/bdwgc/actions/runs/7273056790 where 1 out of 12 jobs failed. I can reproduce it locally where it is intermittent. I think it only happens with assertions enabled.

For example, here are two runs, one succeeding and one failing:

kll@ThinkYoga:~/terastream/acton-deps/bdwgc$ /home/kll/terastream/acton-deps/bdwgc/zig-cache/o/dc24990df2d413d251b3167248ce0c18/gctest
Switched to incremental mode
Reading dirty bits from /proc
Completed 6 tests
Allocated 4281275 collectable objects
Allocated 1218 uncollectable objects
Allocated 8216838 atomic objects
Reallocated 756 objects
Garbage collection after fork is tested too
Finalized 13218/13218 objects - finalization is probably OK
Total number of bytes allocated is 1140762464
Total memory use by allocated blocks is 806912 bytes
Final heap size is 217088 bytes
Obtained 13279232 bytes from OS (of which 11415552 bytes unmapped)
Final number of reachable objects is 2434
Full/world-stopped collections took 215/4224 ms
Completed 2392 collections
Collector appears to work
kll@ThinkYoga:~/terastream/acton-deps/bdwgc$ /home/kll/terastream/acton-deps/bdwgc/zig-cache/o/dc24990df2d413d251b3167248ce0c18/gctest
Switched to incremental mode
Reading dirty bits from /proc
List reversal produced incorrect list - collector is broken
Test failed
Aborted (core dumped)
kll@ThinkYoga:~/terastream/acton-deps/bdwgc$ gdb /home/kll/terastream/acton-deps/bdwgc/zig-cache/o/dc24990df2d413d251b3167248ce0c18/gctest core
...
(gdb) bt
#0  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at ./nptl/pthread_kill.c:44
#1  0x00007f57740e1d2f in __pthread_kill_internal (signo=6, threadid=<optimized out>) at ./nptl/pthread_kill.c:78
#2  0x00007f5774092ef2 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#3  0x00007f577407d472 in __GI_abort () at ./stdlib/abort.c:79
#4  0x00000000002090b6 in check_ints (list=0x7f577401c920, low=1, up=49) at tests/gctest.c:573
#5  0x0000000000208c63 in reverse_test_inner (data=0x1) at tests/gctest.c:936
#6  0x00007f5774286fb0 in GC_call_with_gc_active (fn=0x208970 <reverse_test_inner>, client_data=0x1) at extra/../misc.c:2284
#7  0x000000000020899b in reverse_test_inner (data=0x0) at tests/gctest.c:860
#8  0x00007f5774287185 in GC_do_blocking_inner (data=0x7fffe58063a0 "p\211 ", context=0x7fffe5805f80) at extra/../misc.c:2318
#9  0x00007f57742828e4 in GC_with_callee_saves_pushed (fn=0x7f57742870a0 <GC_do_blocking_inner>, arg=0x7fffe58063a0 "p\211 ") at extra/../mach_dep.c:337
#10 0x00007f5774287420 in GC_do_blocking (fn=0x208970 <reverse_test_inner>, client_data=0x0) at extra/../misc.c:2366
#11 0x00000000002080a4 in reverse_test () at tests/gctest.c:996
#12 0x00000000002066e1 in run_one_test () at tests/gctest.c:1911
#13 0x00000000002052c8 in main () at tests/gctest.c:2325
(gdb) 
Click me
(gdb) bt full
#0  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at ./nptl/pthread_kill.c:44
        tid = <optimized out>
        ret = 0
        pd = <optimized out>
        old_mask = {__val = {140737043782864}}
        ret = <optimized out>
#1  0x00007f57740e1d2f in __pthread_kill_internal (signo=6, threadid=<optimized out>) at ./nptl/pthread_kill.c:78
No locals.
#2  0x00007f5774092ef2 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
        ret = <optimized out>
#3  0x00007f577407d472 in __GI_abort () at ./stdlib/abort.c:79
        save_stage = 1
        act = {__sigaction_handler = {sa_handler = 0x20, sa_sigaction = 0x20}, sa_mask = {__val = {140013585154752, 140737043782960, 2134287, 25769803826, 140013585154720, 140737043782992, 2134287, 21474836530, 
              140013585653813, 140737043783024, 140013584338480, 140737043783088, 140013584338560, 140013584338672, 140013584338512, 140013584338528}}, sa_flags = 1948806097, sa_restorer = 0x7fffe5805db0}
#4  0x00000000002090b6 in check_ints (list=0x7f577401c920, low=1, up=49) at tests/gctest.c:573
No locals.
#5  0x0000000000208c63 in reverse_test_inner (data=0x1) at tests/gctest.c:936
        i = 10
        b = 0x7f577401c200
        c = 0x7f5773f52da8
        d = 0x7f5774025d18
        e = 0x7f5774025d00
        f = 0x7f5774028fc0
        g = 0x7f5774022000
        h = 0x7f5773c14000
#6  0x00007f5774286fb0 in GC_call_with_gc_active (fn=0x208970 <reverse_test_inner>, client_data=0x1) at extra/../misc.c:2284
        stacksect = {saved_stack_ptr = 0x7fffe5805f48 "\240c\200\345\377\177", prev = 0x0}
#7  0x000000000020899b in reverse_test_inner (data=0x0) at tests/gctest.c:860
        i = 0
        b = 0x0
        c = 0x0
        d = 0x0
        e = 0x0
        f = 0x0
        g = 0x0
        h = 0x0
#8  0x00007f5774287185 in GC_do_blocking_inner (data=0x7fffe58063a0 "p\211 ", context=0x7fffe5805f80) at extra/../misc.c:2318
        d = 0x7fffe58063a0
#9  0x00007f57742828e4 in GC_with_callee_saves_pushed (fn=0x7f57742870a0 <GC_do_blocking_inner>, arg=0x7fffe58063a0 "p\211 ") at extra/../mach_dep.c:337
        getcontext_works = 1 '\001'
        dummy = 0
        context = 0x7fffe5805f80 ""
        ctxt = {uc_flags = 0, uc_link = 0x0, uc_stack = {ss_sp = 0x0, ss_flags = 0, ss_size = 0}, uc_mcontext = {gregs = {0, 0, 0, 0, 140013584338560, 140013584338672, 140013584338512, 140013584338528, 140737043783552, 
              140737043784608, 140737043784592, 140013584338480, 0, 0, 477568, 140737043783536, 140013587671079, 0, 0, 0, 0, 0, 0}, fpregs = 0x7fffe5806128, __reserved1 = {0, 0, 0, 0, 0, 0, 0, 0}}, uc_sigmask = {__val = {
              0 <repeats 16 times>}}, __fpregs_mem = {cwd = 895, swd = 65535, ftw = 0, fop = 65535, rip = 4294967295, rdp = 0, mxcsr = 8064, mxcr_mask = 0, _st = {{significand = {0, 0, 0, 0}, exponent = 0, 
                __glibc_reserved1 = {0, 0, 0}}, {significand = {0, 0, 0, 0}, exponent = 0, __glibc_reserved1 = {0, 0, 0}}, {significand = {0, 0, 0, 0}, exponent = 0, __glibc_reserved1 = {0, 0, 0}}, {significand = {0, 0, 0, 
                  0}, exponent = 0, __glibc_reserved1 = {0, 0, 0}}, {significand = {0, 0, 0, 0}, exponent = 0, __glibc_reserved1 = {0, 0, 0}}, {significand = {0, 0, 0, 0}, exponent = 0, __glibc_reserved1 = {0, 0, 0}}, {
                significand = {0, 0, 0, 0}, exponent = 0, __glibc_reserved1 = {0, 0, 0}}, {significand = {0, 0, 0, 0}, exponent = 0, __glibc_reserved1 = {0, 0, 0}}}, _xmm = {{element = {0, 0, 0, 0}} <repeats 14 times>, {
                element = {1939654848, 32599, 3850395952, 32767}}, {element = {1944465392, 32599, 3850396400, 32767}}}, __glibc_reserved1 = {1948692024, 32599, 3850395952, 32767, 3850396352, 32767, 1944465392, 32599, 
              1944465392, 32599, 3850396480, 32767, 1948768059, 32599, 0, 16777216, 1, 0, 1948843952, 32599, 1944462400, 32599, 0, 0}}, __ssp = {1948764751, 8, 140013583344704, 140737043784544}}
        old_fcw = 895
#10 0x00007f5774287420 in GC_do_blocking (fn=0x208970 <reverse_test_inner>, client_data=0x0) at extra/../misc.c:2366
        my_data = {fn = 0x208970 <reverse_test_inner>, client_data = 0x0}
#11 0x00000000002080a4 in reverse_test () at tests/gctest.c:996
No locals.
#12 0x00000000002066e1 in run_one_test () at tests/gctest.c:1911
        ws = L"abc"
        x = 0x7f577401bff0 "a"
        y = 0x206d60 <fail_proc1> "UH\211\345H\211}\370H\213\005\361\063\006"
        z = 0x7f5773f54f50
        start_time = {tv_sec = 1129619, tv_nsec = 418266725}
        reverse_time = {tv_sec = 0, tv_nsec = 0}
        time_diff = 555595507
        pid = 492805
        wstatus = 0
--Type <RET> for more, q to quit, c to continue without paging--
        thr_hndl_sb = {gc_thread_handle = 0x7f5774362000 <GC_stackbottom>, sb = {mem_base = 0x7fffe5806720}}
#13 0x00000000002052c8 in main () at tests/gctest.c:2325
        i = 2
(gdb) 

I'm pretty sure I've gotten the compilation flags etc correct by now so I'm really quite stumped by this and I'm not sure what to do.

@ivmai
Copy link
Owner

ivmai commented Dec 20, 2023

Please create a separate issue about the failure.

@plajjan
Copy link
Contributor Author

plajjan commented Dec 20, 2023

I discovered one more -Werror, not entirely sure why it doesn't show up in the CMake builds since it also applies -Werror but I suspect this is zigs extra default flags to clang to enable more sanitization and similar.

@plajjan
Copy link
Contributor Author

plajjan commented Dec 20, 2023

Ok, I addressed the warning / error in mallo.c and enabled -Werror in last commit, hope you're ok with that sort of fix!?

@plajjan
Copy link
Contributor Author

plajjan commented Dec 20, 2023

There are actually 2 tests out of the 12 that intermittently fail and we can see it failing in this last run after my latest commit, see https://github.com/ivmai/bdwgc/actions/runs/7281080470?pr=598

@plajjan
Copy link
Contributor Author

plajjan commented Dec 20, 2023

@ivmai Apart from this intermittently failing test I think I've addressed all your feedback and improved various other things along the way. I don't think I have any more changes planned, so I think another review of build.zig would be in place :)

This adds a build.zig that allows building the garbage collector using
the Zig build system. It implements a subset of the configuration
options offered by CMake and following the naming convention in CMake
for all those options.

There are two new GitHub Actions workflows:
- zig build is essentially a copy of the cmake build workflow
  - it builds the collector and runs tests
- zig xbuild uses zig to cross-compile for different platforms
  - we don't actually run the tests as that would require emulation

The README is slightly updated, not just adding an explanation of zig
but restructuring the whole section on how to build the GC somewhat.

The build.zig follows the format used in zig v0.12. The final 0.12
version is not out yet, so users will have to use a build from the zig
master branch for now. This is not ideal but the whole zig build system
is so new that there have been backwards incompatible changes from 0.11
which is why we opt to use 0.12 that is likely going to be closer to the
final form.

There is no support for installing documentation currently.
ivmai pushed a commit that referenced this pull request Dec 21, 2023
(refactoring)

PR #598 (bdwgc).

* CMakeLists.txt (SRC): Order items lexicographically.
* Makefile.am [!SINGLE_GC_OBJ] (libgc_la_SOURCES): Likewise.
ivmai pushed a commit that referenced this pull request Dec 21, 2023
PR #598 (bdwgc).

* malloc.c [REDIRECT_FREE && !REDIRECT_MALLOC_IN_HEADER && IGNORE_FREE]
(free): Specify p is an unused argument.
ivmai added a commit that referenced this pull request Dec 21, 2023
PR #598 (bdwgc).

* README.md (Installation and Portability): Rename to
"Building and Installing"; move Portability to a separate section; describe
every build system (cmake, autoconf, nmake, Makefile.direct, manual C
compilation) in a separate sub-section; update time how long gctest may
be running; move information about configurable macros and libatomic_ops to
separate sub-sections.

Co-authored-by: Ivan Maidanski <[email protected]>
@ivmai
Copy link
Owner

ivmai commented Dec 21, 2023

I have push your change of readme with some modification. Plus 2 your changes.

build.zig Show resolved Hide resolved
build.zig Show resolved Hide resolved
build.zig Show resolved Hide resolved
build.zig Show resolved Hide resolved
strategy:
fail-fast: false
matrix:
ttriple: [ aarch64-linux-musl, wasm32-wasi, x86_64-linux-gnu.2.27, x86_64-linux-musl, x86_64-windows-gnu ]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How to cross-compile for MacOS? I've failed to

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be a simple matter of: zig build -Dtarget=x86_64-macos-none

Or aarch64-macos-none for apple silicon...

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This results in an error:
.../bdwgc/extra/../os_dep.c:4354:10: error: 'mach/exception.h' file not found

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ivmai ah yes, that's correct. I forgot I'm running with a patched zig. Zig doesn't ship with the correct headers just yet. I opened an issue for this ziglang/zig#18257. They're usually quite fast adding headers but I'm guessing it'll be after the holidays.

In Acton we add in a few extra headers, see https://github.com/actonlang/acton/tree/main/deps/zig-extras/lib/libc/include/any-macos-any

You can do the same, just copy into your zig/lib/...

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, let's wait for right nightly build and then add macos targets.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right yes, agreed, let's wait for it.. I was just thinking if you wanted to test stuff locally first :)

ivmai added a commit that referenced this pull request Dec 24, 2023
PR #598 (bdwgc).

This adds a build.zig that allows building the garbage collector using
the Zig build system.  It implements a subset of the configuration
options offered by CMake and following the naming convention in CMake
for all those options.

The README is slightly updated adding an explanation of zig.

The build.zig follows the format used in zig v0.12.0-dev.1814.
The final 0.12 version is not out yet, so users will have to use
a build from the zig master branch for now.  This is not ideal but the
whole zig build system is so new that there have been backwards
incompatible changes from 0.11 which is why we opt to use 0.12 that is
likely going to be closer to the final form.

* README.md (Building and Installing): Add subsection about Zig.
* Makefile.am (EXTRA_DIST): Add build.zig item.
* build.zig: New file.

Co-authored-by: Ivan Maidanski <[email protected]>
ivmai pushed a commit that referenced this pull request Dec 24, 2023
PR #598 (bdwgc).

zig-xbuild uses zig to cross-compile for different platforms; we do not
actually run the tests as that would require emulation.
@ivmai
Copy link
Owner

ivmai commented Dec 24, 2023

I've pushed your PR with plenty of modifications. Please test it.
I'm still processing zig-build.yml

@ivmai
Copy link
Owner

ivmai commented Dec 25, 2023

Please create a separate issue about the failure.

I've created #601

ivmai added a commit that referenced this pull request Dec 25, 2023
(fix of commit 2666e3e)

PR #598 (bdwgc).

* build.zig (build): Remove FIXME along with commented out "-O2" flag.
ivmai added a commit that referenced this pull request Dec 25, 2023
ivmai added a commit that referenced this pull request Dec 25, 2023
PR #598 (bdwgc).

zig build is essentially a copy of the cmake build workflow - it builds
the collector and runs its tests in various configurations.

Co-authored-by: Ivan Maidanski <[email protected]>
ivmai added a commit that referenced this pull request Dec 25, 2023
@ivmai ivmai closed this Dec 25, 2023
@ivmai ivmai mentioned this pull request Dec 25, 2023
11 tasks
ivmai pushed a commit that referenced this pull request Feb 2, 2024
(a cherry-pick of commit c3e77d2 from 'master')

PR #598 (bdwgc).

* malloc.c [REDIRECT_FREE && !REDIRECT_MALLOC_IN_HEADER]
(free): Specify p is an unused argument.
ivmai pushed a commit that referenced this pull request Feb 3, 2024
(a cherry-pick of commit c3e77d2 from 'master')

PR #598 (bdwgc).

* malloc.c [REDIRECT_FREE && !REDIRECT_MALLOC_IN_HEADER]
(free): Specify p is an unused argument.
ivmai pushed a commit that referenced this pull request Feb 3, 2024
(a cherry-pick of commit c3e77d2 from 'master')

PR #598 (bdwgc).

* malloc.c [REDIRECT_FREE && !REDIRECT_MALLOC_IN_HEADER]
(free): Specify p is an unused argument.
ivmai pushed a commit that referenced this pull request Feb 3, 2024
(a cherry-pick of commit 6564edd from 'release-7_6')

PR #598 (bdwgc).

* malloc.c [REDIRECT_FREE] (free): Specify p is an unused argument.
ivmai pushed a commit that referenced this pull request Mar 19, 2024
(fix of commit c3e77d2)

PR #598 (bdwgc).

* malloc.c [REDIRECT_FREE && !REDIRECT_MALLOC_IN_HEADER && IGNORE_FREE]
(free): Remove '#' before UNUSED_ARG().
ivmai added a commit that referenced this pull request Apr 27, 2024
(fix of commit 2666e3e)

PR #598 (bdwgc).

* build.zig (build): Remove commented out -Wno-long-long flag; simplify
conditional expressions.
* build.zig (build): Do not add -D HAVE_DL_ITERATE_PHDR to flags if
t.os.tag==.windows or t.isDarwin().
ivmai added a commit that referenced this pull request Apr 27, 2024
(fix of commit 2666e3e)

PR #598 (bdwgc).

Zig windows-gnu target is MinGW-based build.  In this case pthreads
library is not used by bdwgc.

* build.zig [enable_threads] (build): Move GC_THREADS and PARALLEL_MARK
macros definition upper; add TODO item about Cygwin; add gc_dlopen.c,
specific.c to source_files only if t.os.tag!=.windows; define
_REENTRANT, HANDLE_FORK, GC_USESIGRT_SIGNALS macros only if
t.os.tag!=.windows; do not add threadkeytest to tests if
t.os.tag==.windows.
* build.zig (build): Set have_getcontext to false if
t.os.tag==.windows.
* build.zig (build): Do not define HAVE_DLADDR macro if
t.os.tag==.windows.
* build.zig [install_headers && enable_threads] (build): Do not install
gc_pthread_redirects.h if t.os.tag!=.windows.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants