Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 910195 - sys-apps/sandbox-2.35 fails using Clang as compiler with incompatible integer to pointer conversion
Summary: sys-apps/sandbox-2.35 fails using Clang as compiler with incompatible integer...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: ARM64 Linux
: Normal normal (vote)
Assignee: Sandbox Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-07-10 14:35 UTC by Andy
Modified: 2023-07-11 01:20 UTC (History)
1 user (show)

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


Attachments
build.log (build.log,88.76 KB, text/plain)
2023-07-10 14:43 UTC, Andy
Details
libsandbox/trace: cast NT_ARM_SYSTEM_CALL to void * (0001-libsandbox-trace-cast-NT_ARM_SYSTEM_CALL-to-void.patch,1.08 KB, patch)
2023-07-10 15:15 UTC, Mike Gilbert
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andy 2023-07-10 14:35:30 UTC
When compiling sandbox-2.35 on ARM64 using Clang as system compiler.
Using LTO or noLTO does not change, the issue is a pointer conversion in /libsandbox/trace/linux/aarch64.c in the do_ptrace function, resulting in the error incompatible integer to pointer conversion passing 'int' to parameter of type 'void *' [-Wint-conversion]

Reproducible: Always

Steps to Reproduce:
1. Set clang as system compiler on ARM64
2. Compile Sandbox-2.35
3. Emerge breaks
Actual Results:  
incompatible integer to pointer conversion passing 'int' to parameter of type 'void *' [-Wint-conversion]

Expected Results:  
Clean compilation
Comment 1 Andy 2023-07-10 14:36:05 UTC
Portage 3.0.49 (python 3.12.0-beta-3, default/linux/arm64/17.0/systemd/llvm/merged-usr, gcc-13, glibc-2.37-r3, 6.4.2-gentoo aarch64)
=================================================================
System uname: Linux-6.4.2-gentoo-aarch64-with-glibc2.37
KiB Mem:     3796544 total,    143468 free
KiB Swap:   27063284 total,  26190960 free
Timestamp of repository gentoo: Mon, 10 Jul 2023 09:31:42 +0000
Head commit of repository gentoo: a7c662424eaa0e1cc1a3143fbf32685be4d423b9

sh dash 0.5.12
ld GNU ld (Gentoo 2.40 p5) 2.40.0
app-misc/pax-utils:        1.3.7::gentoo
app-shells/bash:           5.2_p15-r6::gentoo
dev-java/java-config:      2.3.1-r1::gentoo
dev-lang/perl:             5.38.0::gentoo
dev-lang/python:           3.11.4::gentoo, 3.12.0_beta3::gentoo
dev-lang/rust:             1.70.0::gentoo
dev-util/cmake:            3.26.4-r1::gentoo
dev-util/meson:            1.1.1::gentoo
sys-apps/baselayout:       2.14::gentoo
sys-apps/sandbox:          2.34::gentoo
sys-apps/systemd:          253.5-r1::gentoo
sys-devel/autoconf:        2.71-r6::gentoo
sys-devel/automake:        1.16.5-r1::gentoo
sys-devel/binutils:        2.40-r5::gentoo
sys-devel/binutils-config: 5.5::gentoo
sys-devel/clang:           16.0.6::gentoo
sys-devel/gcc:             13.1.1_p20230527::gentoo
sys-devel/gcc-config:      2.11::gentoo
sys-devel/libtool:         2.4.7-r1::gentoo
sys-devel/lld:             16.0.6::gentoo
sys-devel/llvm:            16.0.6::gentoo
sys-devel/make:            4.4.1-r1::gentoo
sys-kernel/linux-headers:  6.4::gentoo (virtual/os-headers)
sys-libs/glibc:            2.37-r3::gentoo
Repositories:

gentoo
    location: /var/db/repos/gentoo
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/gentoo.git
    priority: -1000
    volatile: False

local
    location: /var/db/repos/local
    masters: gentoo
    volatile: False

ACCEPT_KEYWORDS="arm64 ~arm64"
ACCEPT_LICENSE="*"
ADDR2LINE="llvm-addr2line"
AR="llvm-ar"
AS="clang -c"
CBUILD="aarch64-unknown-linux-gnu"
CC="clang"
CFLAGS="-mcpu=cortex-a53+crypto -O2 -pipe -flto=thin"
CHOST="aarch64-unknown-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d"
CPP="clang-cpp"
CXX="clang++"
CXXFLAGS="-mcpu=cortex-a53+crypto -O2 -pipe -flto=thin"
DISTDIR="/var/cache/distfiles"
EMERGE_DEFAULT_OPTS="--quiet-build --with-bdeps=y"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GDK_PIXBUF_MODULE_FILE GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR XDG_STATE_HOME"
FCFLAGS="-mcpu=cortex-a53+crypto -O2 -pipe -flto=thin"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs binpkg-multi-instance buildpkg-live cgroup config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch parallel-install pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-mcpu=cortex-a53+crypto -O2 -pipe -flto=thin"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="en_US.UTF-8"
LD="ld.lld"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -fuse-ld=lld -rtlib=compiler-rt -unwindlib=libunwind -Wl,--as-needed  -Wl,-O2 -Wl,--as-needed"
LEX="flex"
MAKEOPTS="-j2"
NM="llvm-nm"
OBJCOPY="llvm-objcopy"
OBJDUMP="llvm-objdump"
PKGDIR="/var/cache/binpkgs"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
RANLIB="llvm-ranlib"
READELF="llvm-readelf"
SHELL="/bin/bash"
STRINGS="llvm-strings"
STRIP="llvm-strip"
USE="acl arm64 btrfs bzip2 caps clang cli crypt dri fortran gdbm iconv icu idn ipv6 jpeg libedit libtirpc llvm-libunwind lto lz4 mbedtls ncurses nettle nls nptl openmp pam pcre pgo python readline seccomp ssl systemd test test-rust threads tiff udev unicode verify-sig wayland webp xattr zlib zstd" ADA_TARGET="gnat_2021" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_ARM="edsp vfp vfpv3 vfpv4 vfp-d32 aes sha1 sha2 crc32 v8" CURL_SSL="mbedtls" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="libinput" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LUA_SINGLE_TARGET="lua5-4" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php8-1" POSTGRES_TARGETS="postgres12 postgres13" PYTHON_SINGLE_TARGET="python3_12" PYTHON_TARGETS="python3_12" RUBY_TARGETS="ruby32" VIDEO_CARDS="panfrost" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq proto steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  ARFLAGS, ASFLAGS, CCLD, CONFIG_SHELL, CPPFLAGS, CTARGET, CXXFILT, ELFEDIT, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, INSTALL_MASK, LC_ALL, LFLAGS, LIBTOOL, LINGUAS, MAKE, MAKEFLAGS, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, RUSTFLAGS, SIZE, YACC, YFLAGS
Comment 2 Andy 2023-07-10 14:43:37 UTC
Created attachment 865337 [details]
build.log
Comment 3 Mike Gilbert gentoo-dev 2023-07-10 15:01:30 UTC
I don't think that should be an error under normal circumstances. Do you have any relevant settings (like Werror=int-conversion) in /etc/clang?
Comment 4 Mike Gilbert gentoo-dev 2023-07-10 15:15:01 UTC
Created attachment 865340 [details, diff]
libsandbox/trace: cast NT_ARM_SYSTEM_CALL to void *

Please test this patch. You should be able to place it at /etc/portage/sys-apps/sandbox/.
Comment 5 Mike Gilbert gentoo-dev 2023-07-10 15:49:35 UTC
Comment on attachment 865340 [details, diff]
libsandbox/trace: cast NT_ARM_SYSTEM_CALL to void *

Never mind, I also need to cast to an appropriate integer size.
Comment 6 Larry the Git Cow gentoo-dev 2023-07-10 15:50:45 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/sandbox.git/commit/?id=12c24e7f990dec058563ca1ef954bfd8264f2f96

commit 12c24e7f990dec058563ca1ef954bfd8264f2f96
Author:     Mike Gilbert <floppym@gentoo.org>
AuthorDate: 2023-07-10 15:11:41 +0000
Commit:     Mike Gilbert <floppym@gentoo.org>
CommitDate: 2023-07-10 15:47:36 +0000

    libsandbox/trace: cast NT_ARM_SYSTEM_CALL to avoid warnings
    
    Bug: https://bugs.gentoo.org/910195
    Signed-off-by: Mike Gilbert <floppym@gentoo.org>

 libsandbox/trace/linux/aarch64.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Comment 7 Larry the Git Cow gentoo-dev 2023-07-10 16:00:36 UTC
The bug has been closed via the following commit(s):

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

commit e934584543ac2b662490fe1a265949c1930deb9c
Author:     Mike Gilbert <floppym@gentoo.org>
AuthorDate: 2023-07-10 15:59:53 +0000
Commit:     Mike Gilbert <floppym@gentoo.org>
CommitDate: 2023-07-10 15:59:53 +0000

    sys-apps/sandbox: add 2.36
    
    Closes: https://bugs.gentoo.org/910195
    Signed-off-by: Mike Gilbert <floppym@gentoo.org>

 sys-apps/sandbox/Manifest            |  1 +
 sys-apps/sandbox/sandbox-2.36.ebuild | 64 ++++++++++++++++++++++++++++++++++++
 2 files changed, 65 insertions(+)
Comment 8 Andy 2023-07-11 01:17:18 UTC
(In reply to Mike Gilbert from comment #3)
> I don't think that should be an error under normal circumstances. Do you
> have any relevant settings (like Werror=int-conversion) in /etc/clang?

No, standard clang settings only, with stricter USE flag disabled for clang-common
Comment 9 Andy 2023-07-11 01:20:21 UTC
(In reply to Larry the Git Cow from comment #7)
> The bug has been closed via the following commit(s):
> 
> https://gitweb.gentoo.org/repo/gentoo.git/commit/
> ?id=e934584543ac2b662490fe1a265949c1930deb9c
> 
> commit e934584543ac2b662490fe1a265949c1930deb9c
> Author:     Mike Gilbert <floppym@gentoo.org>
> AuthorDate: 2023-07-10 15:59:53 +0000
> Commit:     Mike Gilbert <floppym@gentoo.org>
> CommitDate: 2023-07-10 15:59:53 +0000
> 
>     sys-apps/sandbox: add 2.36
>     
>     Closes: https://bugs.gentoo.org/910195
>     Signed-off-by: Mike Gilbert <floppym@gentoo.org>
> 
>  sys-apps/sandbox/Manifest            |  1 +
>  sys-apps/sandbox/sandbox-2.36.ebuild | 64
> ++++++++++++++++++++++++++++++++++++
>  2 files changed, 65 insertions(+)

Confirmed, sandbox-2.36 compiles just fine.
Thanks for the fast support.