Skip to content

Conversation

@ghpzin
Copy link
Contributor

@ghpzin ghpzin commented Mar 25, 2025

cen64: unstable-2022-10-02 -> 0-unstable-2023-05-29


cen64: fix build with gcc14

  • add patch from unmerged upstream PR (only bus/controller.c, other changes are already applied in master):
    n64dev/cen64@f13bdf9
    fixes error from gcc14:
    error: initialization of ... from incompatible pointer type

  • add patch from unmerged upstream PR:
    Fix thread arg type for pthread_setname_np n64dev/cen64#237
    fixes errors from gcc14:
    error: passing argument 1 of 'cen64_thread_setname' makes pointer from integer without a cast [-Wint-conversion]
    error: passing argument 1 of 'cen64_thread_setname' makes integer from pointer without a cast [-Wint-conversion]


Fixes build failure of cen64 since 2025-01-14 (update to GCC14 in #356812):
https://hydra.nixos.org/job/nixos/trunk-combined/nixpkgs.cen64.x86_64-linux
https://hydra.nixos.org/build/292986743

Error log (fixed with cast-mi_regs-callbacks.patch):

/build/source/bus/controller.c: In function 'bus_init':
/build/source/bus/controller.c:47:6: error: initialization of 'int (*)(void *, uint32_t,  uint32_t *)' {aka 'int (*)(void *, unsigned int,  unsigned int *)'} from incompatible pointer type 'int (*)(struct vr4300 *, uint32_t,  uint32_t *)' {aka 'int (*)(struct vr4300 *, unsigned int,  unsigned int *)'} []
   47 |     {read_mi_regs, write_mi_regs, MI_REGS_BASE_ADDRESS, MI_REGS_ADDRESS_LEN},
      |      ^~~~~~~~~~~~
/build/source/bus/controller.c:47:6: note: (near initialization for 'mappings[2].read')
/build/source/bus/controller.c:47:20: error: initialization of 'int (*)(void *, uint32_t,  uint32_t,  uint32_t)' {aka 'int (*)(void *, unsigned int,  unsigned int,  unsigned int)'} from incompatible pointer type 'int (*)(struct vr4300 *, uint32_t,  uint32_t,  uint32_t)' {aka 'int (*)(struct vr4300 *, unsigned int,  unsigned int,  unsigned int)'} []
   47 |     {read_mi_regs, write_mi_regs, MI_REGS_BASE_ADDRESS, MI_REGS_ADDRESS_LEN},
      |                    ^~~~~~~~~~~~~
/build/source/bus/controller.c:47:20: note: (near initialization for 'mappings[2].write')

After applying first patch other errors come up (fixed with fix-thread-arg-type-for-pthread_setname_np.patch):

/build/source/cen64.c:475:24: error: passing argument 1 of 'cen64_thread_setname' makes pointer from integer without a cast [-Wint-conversion]
  475 |   cen64_thread_setname(thread, "device");
      |                        ^~~~~~
      |                        |
      |                        cen64_thread {aka long unsigned int}
In file included from /build/source/device/device.h:26,
                 from /build/source/cen64.c:15:
/build/source/os/posix/thread.h:59:54: note: expected 'cen64_thread *' {aka 'long unsigned int *'} but argument is of type 'cen64_thread' {aka 'lo>
   59 | static inline int cen64_thread_setname(cen64_thread *t, const char *name) {
      |                                        ~~~~~~~~~~~~~~^
/build/source/gdb/gdb.c:82:24: error: passing argument 1 of 'cen64_thread_setname' makes integer from pointer without a cast [-Wint-conversion]
   82 |   cen64_thread_setname(NULL, "gdb");
      |                        ^~~~
      |                        |
      |                        void *
/build/source/os/posix/thread.h:59:53: note: expected 'cen64_thread' {aka 'long unsigned int'} but argument is of type 'void *'
   59 | static inline int cen64_thread_setname(cen64_thread t, const char *name) {
      |                                        ~~~~~~~~~~~~~^

Upstream PRs with included patches:
n64dev/cen64#191
n64dev/cen64#237

Tracking issue: #388196

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 25.05 Release Notes (or backporting 24.11 and 25.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@github-actions github-actions bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. labels Mar 25, 2025
@nix-owners nix-owners bot requested a review from 414owen March 25, 2025 14:37
@ghpzin
Copy link
Contributor Author

ghpzin commented Mar 25, 2025

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 393091


x86_64-linux

✅ 1 package built:
  • cen64

ghpzin added 2 commits March 26, 2025 00:09
- add patch from unmerged upstream PR (only `bus/controller.c`,
other changes are already applied in master):
n64dev/cen64@f13bdf9
fixes error from gcc14:
`error: initialization of ... from incompatible pointer type`

- add patch from unmerged upstream PR:
n64dev/cen64#237
fixes errors from gcc14:
`error: passing argument 1 of 'cen64_thread_setname' makes pointer from integer without a cast [-Wint-conversion]`
`error: passing argument 1 of 'cen64_thread_setname' makes integer from pointer without a cast [-Wint-conversion]`
@ghpzin ghpzin force-pushed the cen64/fix-build-with-gcc14 branch from d6ba8e4 to d42f9fd Compare March 25, 2025 21:10
@ghpzin ghpzin changed the title cen64: unstable-2022-10-02 -> unstable-2023-05-29, fix build with gcc14 cen64: unstable-2022-10-02 -> 0-unstable-2023-05-29, fix build with gcc14 Mar 25, 2025
@pbsds pbsds merged commit 06bf096 into NixOS:master Apr 7, 2025
43 checks passed
@ghpzin ghpzin deleted the cen64/fix-build-with-gcc14 branch April 8, 2025 04:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants