Skip to content

Conversation

@devnexen
Copy link

No description provided.

@kaniini
Copy link
Owner

kaniini commented Aug 8, 2024

Fix it on what?

@imnotpoz
Copy link

imnotpoz commented Nov 9, 2025

I just hit a build error with 1.3.3 from nixpkgs on aarch64-linux:

$ nix build nixpkgs#libucontext
error: Cannot build '/nix/store/bl0x379jvianpy6y3x8da1mawghmk02x-libucontext-1.3.3.drv'.
       Reason: builder failed with exit code 1.
       Output paths:
         /nix/store/6pyiqb4kdmqfq15lnr0cz864pbj4xxzy-libucontext-1.3.3
       Last 25 log lines:
       > build flags: -j5
       > [1/21] Compiling C object libucontext.so.1.p/arch_aarch64_swapcontext.S.o
       > [2/21] Compiling C object libucontext.so.1.p/arch_aarch64_setcontext.S.o
       > [3/21] Compiling C object libucontext.so.1.p/arch_aarch64_getcontext.S.o
       > [4/21] Compiling C object libucontext_posix.so.1.p/arch_aarch64_getcontext.S.o
       > [5/21] Compiling C object libucontext_posix.so.1.p/arch_aarch64_setcontext.S.o
       > [6/21] Compiling C object libucontext_posix.so.1.p/arch_aarch64_swapcontext.S.o
       > [7/21] Compiling C object libucontext.so.1.p/arch_aarch64_makecontext.c.o
       > FAILED: [code=1] libucontext.so.1.p/arch_aarch64_makecontext.c.o
       > gcc -Ilibucontext.so.1.p -I. -I.. -I../include -I../arch/common -I../arch/common/include -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -std=gnu11 -fPIC -D_DEFAULT_SOURCE -DEXPORT_UNPREFIXED -MD -MQ libucontext.so.1.p/arch_aarch64_makecontext.c.o -MF libucontext.so.1.p/arch_aarch64_makecontext.c.o.d -o libucontext.so.1.p/arch_aarch64_makecontext.c.o -c ../arch/aarch64/makecontext.c
       > ../arch/aarch64/makecontext.c: In function 'libucontext_makecontext':
       > ../arch/aarch64/makecontext.c:48:14: error: assignment to 'long unsigned int *' from incompatible pointer type 'long long unsigned int *' [-Wincompatible-pointer-types]
       >    48 |         regp = &(ucp->uc_mcontext.regs[0]);
       >       |              ^
       > [8/21] Compiling C object libucontext.so.1.p/arch_aarch64_trampoline.c.o
       > [9/21] Compiling C object libucontext_posix.so.1.p/arch_aarch64_makecontext.c.o
       > FAILED: [code=1] libucontext_posix.so.1.p/arch_aarch64_makecontext.c.o
       > gcc -Ilibucontext_posix.so.1.p -I. -I.. -I../include -I../arch/common -I../arch/common/include -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -std=gnu11 -fPIC -D_DEFAULT_SOURCE -DEXPORT_UNPREFIXED -MD -MQ libucontext_posix.so.1.p/arch_aarch64_makecontext.c.o -MF libucontext_posix.so.1.p/arch_aarch64_makecontext.c.o.d -o libucontext_posix.so.1.p/arch_aarch64_makecontext.c.o -c ../arch/aarch64/makecontext.c
       > ../arch/aarch64/makecontext.c: In function 'libucontext_makecontext':
       > ../arch/aarch64/makecontext.c:48:14: error: assignment to 'long unsigned int *' from incompatible pointer type 'long long unsigned int *' [-Wincompatible-pointer-types]
       >    48 |         regp = &(ucp->uc_mcontext.regs[0]);
       >       |              ^
       > [10/21] Compiling C object libucontext_posix.so.1.p/libucontext_posix.c.o
       > [11/21] Compiling C object libucontext_posix.so.1.p/arch_aarch64_trampoline.c.o
       > ninja: build stopped: subcommand failed.
       For full logs, run:
         nix log /nix/store/bl0x379jvianpy6y3x8da1mawghmk02x-libucontext-1.3.3.drv

I'm pretty sure this is what this PR is aiming to fix

@imnotpoz
Copy link

imnotpoz commented Nov 9, 2025

can confirm the changes to libucontext_mcontext_t in this PR match what's present in mcontext_t in glibc 2.40.66 on my system

imnotpoz added a commit to imnotpoz/libucontext that referenced this pull request Nov 9, 2025
```
$ make
gcc -std=gnu99 -D_DEFAULT_SOURCE -fPIC -DPIC -ggdb3 -O2 -Wall -Iinclude -Iarch/aarch64 -Iarch/common -Iarch/common/include -DFORCE_SOFT_FLOAT -DEXPORT_UNPREFIXED -c -o arch/aarch64/makecontext.o arch/aarch64/makecontext.c
arch/aarch64/makecontext.c: In function ‘libucontext_makecontext’:
arch/aarch64/makecontext.c:48:14: error: assignment to ‘long unsigned int *’ from incompatible pointer type ‘long long unsigned int *’ [-Wincompatible-pointer-types]
   48 |         regp = &(ucp->uc_mcontext.regs[0]);
      |              ^
make: *** [Makefile:155: arch/aarch64/makecontext.o] Error 1
```

this both fixes the build error and fixes the rest of mcontext_t to be
compatible with glibc

built on top of the work done in kaniini#59
@imnotpoz imnotpoz mentioned this pull request Nov 9, 2025
@devnexen
Copy link
Author

devnexen commented Nov 9, 2025

Hi @kaniini sorry for late reply, this is what @imnotpoz mentioned, I stumbled across this while testing on my raspberry at the time.

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.

3 participants