Closed gbcox closed 2 years ago
I have this issue in my backlog, but chasing stringop errors is very tedious and I can't promise a solution any time soon.
In the meantime use this export before build the application:
export CFLAGS='-Wno-stringop-truncation -Wno-unused-parameter -Wno-free-nonheap-object -Wno-format-truncation'
Ping back here if it doesn't work. (also you could bother @jwflory for building the new version for his repo :P)
Thanks! I also had to add: -fPIE because of the following:
/usr/bin/ld: mpris-scrobbler-signon.p/meson-generated_mpris-scrobbler-signon-unity0.c.o: relocation R_X86_64_32 against `.rodata' can not be used when making a PIE object; recompile with -fPIE
so the meson build is now:
%meson --buildtype=release -Dc_args="-fPIE -Wno-stringop-truncation -Wno-unused-parameter -Wno-free-nonheap-object -Wno-format-truncation"
Additionally, need to add to the beginning of the spec file:
%global debug_package %{nil}
because of this:
Empty %files file /home/gbcox/rpmbuild/BUILD/mpris-scrobbler-0.5.0/debugsourcefiles.list
Thank you, those sound like great additions. I hope they will be coopted by @jwflory :)
To follow up here, @gbcox reached out to me and he will co-maintain the package in Fedora with me. He already maintains the MusicBrainz Picard package in Fedora and has a much cooler workflow for fast updates than I do, so I'm sure he can help streamline things here too. 😀
Version 4.99 builds just fine, however Version 5.0 fails with the following errors:
setting SOURCE_DATE_EPOCH=1650758400 Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.0plczE Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.OmYU66 The Meson build system Version: 0.59.4 Source dir: /home/gbcox/rpmbuild/BUILD/mpris-scrobbler-0.5.0 Build dir: /home/gbcox/rpmbuild/BUILD/mpris-scrobbler-0.5.0/redhat-linux-build Build type: native build Project name: mpris-scrobbler Project version: undefined C compiler for the host machine: gcc (gcc 11.2.1 "gcc (GCC) 11.2.1 20220401 (Red Hat 11.2.1-10)") C linker for the host machine: gcc ld.bfd 2.37-17 Host machine cpu family: x86_64 Host machine cpu: x86_64 Found pkg-config: /usr/bin/pkg-config (1.8.0) Run-time dependency dbus-1 found: YES 1.12.22 Run-time dependency libcurl found: YES 7.79.1 Run-time dependency libevent_pthreads found: YES 2.1.12-stable Run-time dependency libevent found: YES 2.1.12-stable Run-time dependency json-c found: YES 0.15 Configuring credentials_lastfm.h using configuration Configuring credentials_librefm.h using configuration Configuring credentials_listenbrainz.h using configuration Program git found: YES (/usr/bin/git) Program /usr/bin/meson found: YES (/usr/bin/meson) Program ctags found: YES (/usr/bin/ctags) Program m4 found: YES (/usr/bin/m4) Program scdoc found: YES (/usr/bin/scdoc) Program sh found: YES (/usr/bin/sh) Build targets in project: 9
Option buildtype is: release [default: debug] Found ninja-1.10.2 at /usr/bin/ninja ninja: Entering directory `redhat-linux-build' [1/10] /usr/bin/sh -c '/usr/bin/scdoc < ../doc/mpris-scrobbler.1.scd > mpris-scrobbler.1' [2/10] /usr/bin/sh -c '/usr/bin/scdoc < ../doc/mpris-scrobbler-credentials.5.scd > mpris-scrobbler-credentials.5' [3/10] /usr/bin/sh -c '/usr/bin/scdoc < ../doc/mpris-scrobbler-config.5.scd > mpris-scrobbler-config.5' [4/10] /usr/bin/sh -c '/usr/bin/scdoc < ../doc/mpris-scrobbler-signon.1.scd > mpris-scrobbler-signon.1' [5/10] /usr/bin/meson --internal exe --capture mpris-scrobbler.service -- /usr/bin/m4 -P -DBINPATH=/usr/bin/ -DDAEMONNAME=mpris-scrobbler ../units/systemd-user.service.in [6/10] /usr/bin/meson --internal vcstagger ../src/version.h.in version.h '(unknown)' /home/gbcox/rpmbuild/BUILD/mpris-scrobbler-0.5.0 @GIT_VERSION@ '(.)' /usr/bin/git describe --tags --long --dirty=-git --always fatal: not a git repository (or any parent up to mount point /) Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set). [7/10] gcc -Impris-scrobbler.p -I. -I.. -I../src -I/usr/include/dbus-1.0 -I/usr/lib64/dbus-1.0/include -I/usr/include/json-c -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -Wpedantic -Werror -std=c11 -O3 -Werror=format-truncation=0 -Wno-stringop-overflow -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection '-DAPPLICATION_NAME="mpris-scrobbler"' -MD -MQ mpris-scrobbler.p/meson-generated_mpris-scrobbler-unity0.c.o -MF mpris-scrobbler.p/meson-generated_mpris-scrobbler-unity0.c.o.d -o mpris-scrobbler.p/meson-generated_mpris-scrobbler-unity0.c.o -c mpris-scrobbler.p/mpris-scrobbler-unity0.c FAILED: mpris-scrobbler.p/meson-generated_mpris-scrobbler-unity0.c.o gcc -Impris-scrobbler.p -I. -I.. -I../src -I/usr/include/dbus-1.0 -I/usr/lib64/dbus-1.0/include -I/usr/include/json-c -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -Wpedantic -Werror -std=c11 -O3 -Werror=format-truncation=0 -Wno-stringop-overflow -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection '-DAPPLICATION_NAME="mpris-scrobbler"' -MD -MQ mpris-scrobbler.p/meson-generated_mpris-scrobbler-unity0.c.o -MF mpris-scrobbler.p/meson-generated_mpris-scrobbler-unity0.c.o.d -o mpris-scrobbler.p/meson-generated_mpris-scrobbler-unity0.c.o -c mpris-scrobbler.p/mpris-scrobbler-unity0.c In file included from /usr/include/string.h:519, from /home/gbcox/rpmbuild/BUILD/mpris-scrobbler-0.5.0/redhat-linux-build/../src/structs.h:9, from /home/gbcox/rpmbuild/BUILD/mpris-scrobbler-0.5.0/redhat-linux-build/../src/daemon.c:10, from mpris-scrobbler.p/mpris-scrobbler-unity0.c:1: In function ‘strncpy’, inlined from ‘audioscrobbler_api_response_get_session_key_json’ at /home/gbcox/rpmbuild/BUILD/mpris-scrobbler-0.5.0/redhat-linux-build/../src/audioscrobbler_api.h:148:5: /usr/include/bits/string_fortified.h:95:10: error: ‘strncpy’ output truncated before terminating nul copying as many bytes from a string as its length [-Werror=stringop-truncation] 95 | return builtin___strncpy_chk (dest, src, len, | ^
~~~~~~~~~96 | __glibc_objsize (__dest)); |~~~~~In file included from /home/gbcox/rpmbuild/BUILD/mpris-scrobbler-0.5.0/redhat-linux-build/../src/api.h:79, from /home/gbcox/rpmbuild/BUILD/mpris-scrobbler-0.5.0/redhat-linux-build/../src/daemon.c:12, from mpris-scrobbler.p/mpris-scrobbler-unity0.c:1: /home/gbcox/rpmbuild/BUILD/mpris-scrobbler-0.5.0/redhat-linux-build/../src/audioscrobbler_api.h: In function ‘audioscrobbler_api_response_get_session_key_json’: /home/gbcox/rpmbuild/BUILD/mpris-scrobbler-0.5.0/redhat-linux-build/../src/audioscrobbler_api.h:148:5: note: length computed here 148 | strncpy((char)credentials->user_name, name, strlen(name)); | ^~~~~~~~~~~~~~ In file included from /usr/include/string.h:519, from /home/gbcox/rpmbuild/BUILD/mpris-scrobbler-0.5.0/redhat-linux-build/../src/structs.h:9, from /home/gbcox/rpmbuild/BUILD/mpris-scrobbler-0.5.0/redhat-linux-build/../src/daemon.c:10, from mpris-scrobbler.p/mpris-scrobbler-unity0.c:1: In function ‘strncat’, inlined from ‘audioscrobbler_api_build_request_now_playing’ at /home/gbcox/rpmbuild/BUILD/mpris-scrobbler-0.5.0/redhat-linux-build/../src/audioscrobbler_api.h:512:5: /usr/include/bits/string_fortified.h:138:10: error: ‘strncat’ output may be truncated copying 128 bytes from a string of length 128 [-Werror=stringop-truncation] 138 | return builtin___strncat_chk (dest, src, len, | ^~~~~~~~~~139 | glibc_objsize (__dest)); |~~~~~In function ‘strncat’, inlined from ‘audioscrobbler_api_build_request_now_playing’ at /home/gbcox/rpmbuild/BUILD/mpris-scrobbler-0.5.0/redhat-linux-build/../src/audioscrobbler_api.h:516:5: /usr/include/bits/string_fortified.h:138:10: error: ‘strncat_chk’ output may be truncated copying 128 bytes from a string of length 128 [-Werror=stringop-truncation] 138 | return builtin___strncat_chk (dest, src, len, | ^~~~~~~~~~139 | glibc_objsize (dest)); |~~~~~In function ‘strncat’, inlined from ‘audioscrobbler_api_build_request_scrobble’ at /home/gbcox/rpmbuild/BUILD/mpris-scrobbler-0.5.0/redhat-linux-build/../src/audioscrobbler_api.h:672:5: /usr/include/bits/string_fortified.h:138:10: error: ‘strncat’ output may be truncated copying 128 bytes from a string of length 128 [-Werror=stringop-truncation] 138 | return builtin_strncat_chk (dest, src, len, | ^~~~~~~~~~139 | glibc_objsize (dest)); |~~~~~In function ‘strncat’, inlined from ‘audioscrobbler_api_build_request_scrobble’ at /home/gbcox/rpmbuild/BUILD/mpris-scrobbler-0.5.0/redhat-linux-build/../src/audioscrobbler_api.h:676:5: /usr/include/bits/string_fortified.h:138:10: error: ‘strncat_chk’ output may be truncated copying 128 bytes from a string of length 128 [-Werror=stringop-truncation] 138 | return builtin___strncat_chk (dest, src, len, | ^~~~~~~~~~139 | glibc_objsize (__dest)); |~~~~~cc1: all warnings being treated as errors [8/10] gcc -Impris-scrobbler-signon.p -I. -I.. -I../src -I/usr/include/dbus-1.0 -I/usr/lib64/dbus-1.0/include -I/usr/include/json-c -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -Wpedantic -Werror -std=c11 -O3 -Werror=format-truncation=0 -Wno-stringop-overflow -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection '-DAPPLICATION_NAME="mpris-scrobbler"' -D_POSIX_C_SOURCE=200809L -MD -MQ mpris-scrobbler-signon.p/meson-generated_mpris-scrobbler-signon-unity0.c.o -MF mpris-scrobbler-signon.p/meson-generated_mpris-scrobbler-signon-unity0.c.o.d -o mpris-scrobbler-signon.p/meson-generated_mpris-scrobbler-signon-unity0.c.o -c mpris-scrobbler-signon.p/mpris-scrobbler-signon-unity0.c FAILED: mpris-scrobbler-signon.p/meson-generated_mpris-scrobbler-signon-unity0.c.o gcc -Impris-scrobbler-signon.p -I. -I.. -I../src -I/usr/include/dbus-1.0 -I/usr/lib64/dbus-1.0/include -I/usr/include/json-c -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -Wpedantic -Werror -std=c11 -O3 -Werror=format-truncation=0 -Wno-stringop-overflow -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection '-DAPPLICATION_NAME="mpris-scrobbler"' -D_POSIX_C_SOURCE=200809L -MD -MQ mpris-scrobbler-signon.p/meson-generated_mpris-scrobbler-signon-unity0.c.o -MF mpris-scrobbler-signon.p/meson-generated_mpris-scrobbler-signon-unity0.c.o.d -o mpris-scrobbler-signon.p/meson-generated_mpris-scrobbler-signon-unity0.c.o -c mpris-scrobbler-signon.p/mpris-scrobbler-signon-unity0.c In file included from /usr/include/string.h:519, from /home/gbcox/rpmbuild/BUILD/mpris-scrobbler-0.5.0/redhat-linux-build/../src/structs.h:9, from /home/gbcox/rpmbuild/BUILD/mpris-scrobbler-0.5.0/redhat-linux-build/../src/signon.c:14, from mpris-scrobbler-signon.p/mpris-scrobbler-signon-unity0.c:1: In function ‘strncpy’, inlined from ‘audioscrobbler_api_response_get_session_key_json’ at /home/gbcox/rpmbuild/BUILD/mpris-scrobbler-0.5.0/redhat-linux-build/../src/audioscrobbler_api.h:148:5: /usr/include/bits/string_fortified.h:95:10: error: ‘strncpy’ output truncated before terminating nul copying as many bytes from a string as its length [-Werror=stringop-truncation] 95 | return builtin_strncpy_chk (dest, src, len, | ^~~~~~~~~~96 | glibc_objsize (dest)); |~~~~~In file included from /home/gbcox/rpmbuild/BUILD/mpris-scrobbler-0.5.0/redhat-linux-build/../src/api.h:79, from /home/gbcox/rpmbuild/BUILD/mpris-scrobbler-0.5.0/redhat-linux-build/../src/signon.c:17, from mpris-scrobbler-signon.p/mpris-scrobbler-signon-unity0.c:1: /home/gbcox/rpmbuild/BUILD/mpris-scrobbler-0.5.0/redhat-linux-build/../src/audioscrobbler_api.h: In function ‘audioscrobbler_api_response_get_session_key_json’: /home/gbcox/rpmbuild/BUILD/mpris-scrobbler-0.5.0/redhat-linux-build/../src/audioscrobbler_api.h:148:5: note: length computed here 148 | strncpy((char*)credentials->user_name, name, strlen(name)); | ^~~~~~~~~~~~~~ In file included from /usr/include/string.h:519, from /home/gbcox/rpmbuild/BUILD/mpris-scrobbler-0.5.0/redhat-linux-build/../src/structs.h:9, from /home/gbcox/rpmbuild/BUILD/mpris-scrobbler-0.5.0/redhat-linux-build/../src/signon.c:14, from mpris-scrobbler-signon.p/mpris-scrobbler-signon-unity0.c:1: In function ‘strncat’, inlined from ‘audioscrobbler_api_build_request_now_playing’ at /home/gbcox/rpmbuild/BUILD/mpris-scrobbler-0.5.0/redhat-linux-build/../src/audioscrobbler_api.h:512:5: /usr/include/bits/string_fortified.h:138:10: error: ‘strncat’ output may be truncated copying 128 bytes from a string of length 128 [-Werror=stringop-truncation] 138 | return builtin_strncat_chk (dest, src, len, | ^~~~~~~~~~139 | glibc_objsize (dest)); |~~~~~In function ‘strncat’, inlined from ‘audioscrobbler_api_build_request_now_playing’ at /home/gbcox/rpmbuild/BUILD/mpris-scrobbler-0.5.0/redhat-linux-build/../src/audioscrobbler_api.h:516:5: /usr/include/bits/string_fortified.h:138:10: error: ‘__strncat_chk’ output may be truncated copying 128 bytes from a string of length 128 [-Werror=stringop-truncation] 138 | return builtin_strncat_chk (dest, src, len, | ^~~~~~~~~~139 | glibc_objsize (dest)); |~~~~~In function ‘strncat’, inlined from ‘audioscrobbler_api_build_request_scrobble’ at /home/gbcox/rpmbuild/BUILD/mpris-scrobbler-0.5.0/redhat-linux-build/../src/audioscrobbler_api.h:672:5: /usr/include/bits/string_fortified.h:138:10: error: ‘strncat’ output may be truncated copying 128 bytes from a string of length 128 [-Werror=stringop-truncation] 138 | return builtin_strncat_chk (dest, src, len, | ^~~~~~~~~~139 | glibc_objsize (dest)); |~~~~~In function ‘strncat’, inlined from ‘audioscrobbler_api_build_request_scrobble’ at /home/gbcox/rpmbuild/BUILD/mpris-scrobbler-0.5.0/redhat-linux-build/../src/audioscrobbler_api.h:676:5: /usr/include/bits/string_fortified.h:138:10: error: ‘strncat_chk’ output may be truncated copying 128 bytes from a string of length 128 [-Werror=stringop-truncation] 138 | return builtin___strncat_chk (dest, src, len, | ^~~~~~~~~~139 | __glibc_objsize (__dest)); |~~~~~cc1: all warnings being treated as errors ninja: build stopped: subcommand failed.RPM build errors: