AdaCore/gnatcoverage

Building on RHEL-7 x86_64

Closed this issue · 5 comments

Building on Red Hat Enterprise Linux Server release 7.2, I got the following error:

make -C trace_adapters/valgrind VALGRIND_PREFIX?=/usr
make[1]: Entering directory `/tools/gnatcoverage/tools/gnatcov/trace_adapters/valgrind'
gcc -O2 -g -fno-strict-aliasing -fno-builtin  -fno-stack-protector -Wall -Wmissing-prototypes -Wshadow -Wpointer-arith -Wstrict-prototypes -Wmissing-declarations -Wno-format-zero-length -Wno-long-long  -Wno-pointer-sign -o coverage-amd64-linux cov_traces.o cov_main.o \
            -static -nodefaultlibs -nostartfiles -u _start -Wl,--build-id=none -Wl,-Ttext=0x38000000 /usr/lib/valgrind/libcoregrind-amd64-linux.a /usr/lib/valgrind/libvex-amd64-linux.a -lgcc
gcc: error: /usr/lib/valgrind/libcoregrind-amd64-linux.a: No such file or directory
gcc: error: /usr/lib/valgrind/libvex-amd64-linux.a: No such file or directory
make[1]: *** [coverage-amd64-linux] Error 1
make[1]: Leaving directory `/home/akellol/tools/gnatcoverage-master/tools/gnatcov/trace_adapters/valgrind'
make: *** [adapter-valgrind] Error 2

It turns out that on RHEL7, the valgrind libs are installed in /usr/lib64 but the build expects /usr/lib.

The build was successful using following patch to trace_adapters/valgrind/Makefile :

--- trace_adapters/valgrind/Makefile.orig       2019-11-19 10:17:38.438856776 +0100
+++ trace_adapters/valgrind/Makefile    2019-11-19 12:18:25.853043992 +0100
@@ -6,7 +6,7 @@
 #########
 
 VALGRIND_INCLUDE=$(VALGRIND_PREFIX)/include/valgrind
-VALGRIND_LIBS=$(VALGRIND_PREFIX)/lib/valgrind
+VALGRIND_LIBS=$(wildcard $(VALGRIND_PREFIX)/lib*/valgrind)
 
 CPP_FLAGS=-I. -I$(VALGRIND_INCLUDE) \
           -DVGA_$(VALGRIND_ARCH)=1 -DVGO_linux=1 \

Hello again @okellogg,

Your suggestion seems to be a good idea. Would you be okay to create a pull request for your patch? Thank you in advance!

Hi @pmderodat,
Okay, I'll do that.
By the way, I noticed that there is a trace_adapters/valgrind/Makefile.am but AFAICT it is not used for generating the Makefile.
Can I remove that file as part of my pull request?

Thank you for opening the #6 pull request! We’ll have a look at it as soon as possible.

Yes, we need you to sign the CLA once per project. Thanks!

Thanks for merging #7. Builds fine now.