sysprof-3.40.1 fails to compile when valgrind installed
I installed valgrind-3.17.0, then libdrm-2.4.106 and with these installed sysprof doesn't compile. I removed valgrind, uninstalled libdrm, reinstalled it without valgrind support and then sysprof compiles with no problems. From what I can see, with valgrind installed, sysprof uses the valgrind config.h file. Of course, the required macros are not in this file.
This is the failure:
FAILED: src/sysprof/sysprof.p/sysprof-application.c.o
ccache cc -Isrc/sysprof/sysprof.p -Isrc/sysprof -I../src/sysprof -Isrc/libsysprof-capture -I../src/libsys
prof-capture -Isrc/libsysprof -I../src/libsysprof -Isrc/libsysprof-ui -I../src/libsysprof-ui -I/usr/inclu
de/libmount -I/usr/include/blkid -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/gio-u
nix-2.0 -I/usr/include/json-glib-1.0 -I/usr/include/polkit-1 -I/usr/include/gtk-3.0 -I/usr/include/at-spi
2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -I/usr/include/li
bdrm -I/usr/include/valgrind -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/fribidi -I/u
sr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/lzo -I/usr/include/uuid -I/usr/include/freetype2 -
I/usr/include/libpng16 -I/usr/include/pixman-1 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libdazzle-1.0
-I/usr/src/programming/sysprof/sysprof-3.40.1/build -flto=auto -fdiagnostics-color=always -D_FILE_OFFSET
_BITS=64 -Wall -Winvalid-pch -Wextra -std=gnu11 -g -D_GNU_SOURCE -D_POSIX_C_SOURCE=200809L -Wcast-align -
Wdeclaration-after-statement -Wformat-nonliteral -Wformat-security -Wmissing-include-dirs -Wnested-extern
s -Wno-missing-field-initializers -Wno-sign-compare -Wno-unused-parameter -Wno-cast-function-type -Wpoint
er-arith -Wredundant-decls -Wswitch-default -Wswitch-enum -Wuninitialized -Werror=format-security -Werror
=format=2 -Werror=empty-body -Werror=implicit-function-declaration -Werror=pointer-arith -Werror=init-sel
f -Werror=int-conversion -Werror=misleading-indentation -Werror=missing-include-dirs -Werror=overflow -We
rror=return-type -Werror=shadow -Werror=strict-prototypes -Werror=undef -Werror=incompatible-pointer-type
s -fPIE -pthread -MD -MQ src/sysprof/sysprof.p/sysprof-application.c.o -MF src/sysprof/sysprof.p/sysprof-
application.c.o.d -o src/sysprof/sysprof.p/sysprof-application.c.o -c ../src/sysprof/sysprof-application.
c
../src/sysprof/sysprof-application.c: In function ‘sysprof_about’:
../src/sysprof/sysprof-application.c:203:37: error: ‘SYMBOLIC_VERSION’ undeclared (first use in this func
tion)
203 | "version", SYMBOLIC_VERSION "\n" "(" PACKAGE_VERSION ")",
| ^~~~~~~~~~~~~~~~
../src/sysprof/sysprof-application.c:203:37: note: each undeclared identifier is reported only once for e
ach function it appears in
../src/sysprof/sysprof-application.c:203:53: error: expected ‘)’ before string constant
203 | "version", SYMBOLIC_VERSION "\n" "(" PACKAGE_VERSION ")",
| ^~~~~
| )
../src/sysprof/sysprof-application.c:190:25: note: to match this ‘(’
190 | dialog = g_object_new (GTK_TYPE_ABOUT_DIALOG,
| ^
../src/sysprof/sysprof-application.c: In function ‘sysprof_application_init’:
../src/sysprof/sysprof-application.c:325:19: error: ‘GETTEXT_PACKAGE’ undeclared (first use in this funct
ion)
325 | bindtextdomain (GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR);
| ^~~~~~~~~~~~~~~
../src/sysprof/sysprof-application.c:325:36: error: ‘PACKAGE_LOCALE_DIR’ undeclared (first use in this fu
nction)
325 | bindtextdomain (GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR);
| ^~~~~~~~~~~~~~~~~~
[178/225] Compiling C object src/tests/test-addr-map.p/.._libsysprof_sysprof-map-lookaside.c.o
[179/225] Compiling C object src/sysprof/sysprof.p/sysprof.c.o
FAILED: src/sysprof/sysprof.p/sysprof.c.o
ccache cc -Isrc/sysprof/sysprof.p -Isrc/sysprof -I../src/sysprof -Isrc/libsysprof-capture -I../src/libsys
prof-capture -Isrc/libsysprof -I../src/libsysprof -Isrc/libsysprof-ui -I../src/libsysprof-ui -I/usr/inclu
de/libmount -I/usr/include/blkid -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/gio-u
nix-2.0 -I/usr/include/json-glib-1.0 -I/usr/include/polkit-1 -I/usr/include/gtk-3.0 -I/usr/include/at-spi
2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -I/usr/include/li
bdrm -I/usr/include/valgrind -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/fribidi -I/u
sr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/lzo -I/usr/include/uuid -I/usr/include/freetype2 -
I/usr/include/libpng16 -I/usr/include/pixman-1 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libdazzle-1.0
-I/usr/src/programming/sysprof/sysprof-3.40.1/build -flto=auto -fdiagnostics-color=always -D_FILE_OFFSET
_BITS=64 -Wall -Winvalid-pch -Wextra -std=gnu11 -g -D_GNU_SOURCE -D_POSIX_C_SOURCE=200809L -Wcast-align -
Wdeclaration-after-statement -Wformat-nonliteral -Wformat-security -Wmissing-include-dirs -Wnested-extern
s -Wno-missing-field-initializers -Wno-sign-compare -Wno-unused-parameter -Wno-cast-function-type -Wpoint
er-arith -Wredundant-decls -Wswitch-default -Wswitch-enum -Wuninitialized -Werror=format-security -Werror
=format=2 -Werror=empty-body -Werror=implicit-function-declaration -Werror=pointer-arith -Werror=init-sel
f -Werror=int-conversion -Werror=misleading-indentation -Werror=missing-include-dirs -Werror=overflow -We
rror=return-type -Werror=shadow -Werror=strict-prototypes -Werror=undef -Werror=incompatible-pointer-type
s -fPIE -pthread -MD -MQ src/sysprof/sysprof.p/sysprof.c.o -MF src/sysprof/sysprof.p/sysprof.c.o.d -o src
/sysprof/sysprof.p/sysprof.c.o -c ../src/sysprof/sysprof.c
../src/sysprof/sysprof.c: In function ‘main’:
../src/sysprof/sysprof.c:39:19: error: ‘GETTEXT_PACKAGE’ undeclared (first use in this function)
39 | bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
| ^~~~~~~~~~~~~~~
../src/sysprof/sysprof.c:39:19: note: each undeclared identifier is reported only once for each function
it appears in
../src/sysprof/sysprof.c:39:36: error: ‘LOCALEDIR’ undeclared (first use in this function)
39 | bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
[180/225] Linking target src/tools/list-threads
[181/225] Compiling C object src/tests/test-addr-map.p/.._libsysprof_sysprof-symbol-map.c.o
[182/225] Linking target src/tests/test-capture
[183/225] Linking target src/tools/sysprof-cli
[184/225] Compiling C object src/tests/test-addr-map.p/test-addr-map.c.o
[185/225] Linking target src/tests/test-mapped-ring-buffer
[186/225] Compiling C object src/tests/test-addr-decode.p/test-addr-decode.c.o
[187/225] Linking target src/tests/find-temp-allocs
[188/225] Linking target src/tests/test-capture-cursor
[189/225] Linking target src/tools/sysprof-profiler-ctl
[190/225] Linking target src/libsysprof-ui/libsysprof-ui-4.so
ninja: build stopped: subcommand failed.
Edited by Andre Klapper