Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 937374 - sys-apps/firejail-0.9.72 fails to compile: libtrace.c:457:40: error: passing argument 2 of orig_stat64 from incompatible pointer type [-Wincompatible-pointer-types]
Summary: sys-apps/firejail-0.9.72 fails to compile: libtrace.c:457:40: error: passing ...
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Hank Leininger
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks: c99-porting gcc-14-stable
  Show dependency tree
 
Reported: 2024-08-05 11:49 UTC by Agostino Sarubbo
Modified: 2025-05-07 06:41 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (build.log,136.92 KB, text/plain)
2024-08-05 11:49 UTC, Agostino Sarubbo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Agostino Sarubbo gentoo-dev 2024-08-05 11:49:21 UTC
https://blogs.gentoo.org/ago/2020/07/04/gentoo-tinderbox/

Issue: sys-apps/firejail-0.9.72 fails to compile.
Discovered on: amd64 (internal ref: tinderbox_musl)
System: MUSL-SYSTEM (https://wiki.gentoo.org/wiki/Project:Tinderbox/Common_Issues_Helper#MUSL)

Info about the issue:
https://wiki.gentoo.org/wiki/Project:Tinderbox/Common_Issues_Helper#CF0003
Comment 1 Agostino Sarubbo gentoo-dev 2024-08-05 11:49:22 UTC
Created attachment 899078 [details]
build.log

build log and emerge --info
Comment 2 Andreas K. Hüttel archtester gentoo-dev 2024-11-08 14:33:30 UTC
Builds fine here with gcc-14 and clang-18.  This looks like a musl-only issue where struct stat64 is not defined or defined elsewhere.



libtrace.c:451:59: warning: 'struct stat64' declared inside parameter list will not be visible outside of this definition or declaration
  451 | typedef int (*orig_stat64_t)(const char *pathname, struct stat64 *statbuf);
      |                                                           ^~~~~~
libtrace.c:453:41: warning: 'struct stat64' declared inside parameter list will not be visible outside of this definition or declaration
  453 | int stat64(const char *pathname, struct stat64 *statbuf) {
      |                                         ^~~~~~
libtrace.c: In function 'stat64':
libtrace.c:457:40: error: passing argument 2 of 'orig_stat64' from incompatible pointer type [-Wincompatible-pointer-types[https://gcc.gnu.org/onlinedocs/gcc-14.2.0/gcc/Warning-Options.html#index-Wincompatible-pointer-types]]
  457 |         int rv = orig_stat64(pathname, statbuf);
      |                                        ^~~~~~~
      |                                        |
      |                                        struct stat64 *
libtrace.c:457:40: note: expected 'struct stat64 *' but argument is of type 'struct stat64 *'
libtrace.c: At top level:
x86_64-pc-linux-musl-gcc -pie -fPIE -Wl,-z,relro -Wl,-z,now  -Wl,-O1 -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,--defsym=__gentoo_check_ldflags__=0 -o fnettrace-icmp main.o  
libtrace.c:476:60: warning: 'struct stat64' declared inside parameter list will not be visible outside of this definition or declaration
  476 | typedef int (*orig_lstat64_t)(const char *pathname, struct stat64 *statbuf);
      |                                                            ^~~~~~
libtrace.c:478:42: warning: 'struct stat64' declared inside parameter list will not be visible outside of this definition or declaration
  478 | int lstat64(const char *pathname, struct stat64 *statbuf) {
      |                                          ^~~~~~
libtrace.c: In function 'lstat64':
libtrace.c:482:41: error: passing argument 2 of 'orig_lstat64' from incompatible pointer type [-Wincompatible-pointer-types[https://gcc.gnu.org/onlinedocs/gcc-14.2.0/gcc/Warning-Options.html#index-Wincompatible-pointer-types]]
  482 |         int rv = orig_lstat64(pathname, statbuf);
      |                                         ^~~~~~~
      |                                         |
      |                                         struct stat64 *
libtrace.c:482:41: note: expected 'struct stat64 *' but argument is of type 'struct stat64 *'
Comment 3 Larry the Git Cow gentoo-dev 2025-05-01 21:51:45 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=abaa63e5eb2dd2d25fdaa0cb93ac77f61d78b6bb

commit abaa63e5eb2dd2d25fdaa0cb93ac77f61d78b6bb
Author:     Hank Leininger <hlein@korelogic.com>
AuthorDate: 2025-04-24 22:52:50 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2025-05-01 21:48:05 +0000

    sys-apps/firejail: work around musl stat64 issue
    
    Signed-off-by: Hank Leininger <hlein@korelogic.com>
    Bug: https://bugs.gentoo.org/937374
    Part-of: https://github.com/gentoo/gentoo/pull/41736
    Closes: https://github.com/gentoo/gentoo/pull/41736
    Signed-off-by: Sam James <sam@gentoo.org>

 sys-apps/firejail/firejail-0.9.74.ebuild | 3 +++
 1 file changed, 3 insertions(+)
Comment 4 Hank Leininger 2025-05-07 00:05:39 UTC
@ago could you try to reproduce with 0.9.74 please? I don't have a musl system to test on, but think the usual workaround for stat64 should do the trick.
Comment 5 Agostino Sarubbo gentoo-dev 2025-05-07 06:41:04 UTC
(In reply to Hank Leininger from comment #4)
> @ago could you try to reproduce with 0.9.74 please?

I don't have anymore a musl environment, sorry.