]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Jump through a hoop to make vgtest_ume work again on PIE-supporting systems.
authorNicholas Nethercote <n.nethercote@gmail.com>
Wed, 27 Oct 2004 12:05:59 +0000 (12:05 +0000)
committerNicholas Nethercote <n.nethercote@gmail.com>
Wed, 27 Oct 2004 12:05:59 +0000 (12:05 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2859

memcheck/tests/Makefile.am

index e3e274e9c9810140953459cff7b247eb2978e4ed..14aa31bccc3a9b49288a70a575b90c83af01c6e2 100644 (file)
@@ -147,8 +147,19 @@ new_override_SOURCES       = new_override.cpp
 
 # Valgrind unit self-tests
 hello_SOURCES          = hello.c
+## If we support PIE, build hello as a PIE, otherwise vgtest_ume cannot load
+## (I'm not completely sure why, since stage2 can load both PIEs and non-PIEs,
+## maybe it's because stage2 is loaded up high;  anyway, it doesn't really
+## matter so long as vgtest_ume can load hello ok.  --njn)
+if USE_PIE
+hello_CFLAGS           = $(AM_CFLAGS) -fpie
+hello_LDFLAGS          = -pie
+else
 hello_LDFLAGS          = -Wl,-defsym,kickstart_base=0x50000000 \
                          -Wl,-T,../../coregrind/${VG_ARCH}/stage2.lds
+hello_DEPENDENCIES     = ../../coregrind/${VG_ARCH}/stage2.lds
+endif
+
 vgtest_ume_SOURCES     = vgtest_ume.c
 vgtest_ume_LDADD       = ../../coregrind/ume.o \
                          ../../coregrind/jmp_with_stack.o