Skip to contentSkip to conversation

Add --sysroot when building dlfilters on cross build environments

PATCH In review Arnaldo Carvalho de Melo 2 participants 2 messages Aug 30, 2021 – Aug 31, 2021 perf events

lore
Share & tools
lore

Arnaldo Carvalho de Melo

author maintainer
#0 lore raw

PATCH 1/1 Add --sysroot when building dlfilters on cross build environments

Hi Adrian,

I had to add this cset to fix the build/link on cross build
environments with a sysroot, like Android, EXTRA_CFLAGS is where it will get the needed --sysroot=/opt/android-ndk-r12b//platforms/android-24/arch-arm, please ack.

- Arnaldo

tools/perf/Makefile.perf +2 -2
index 24623599113df215..e04313c4d8409a94 100644
@@ -785,10 +785,10 @@ endif
 
 $(OUTPUT)dlfilters/%.o: dlfilters/%.c include/perf/perf_dlfilter.h
 	$(Q)$(MKDIR) -p $(OUTPUT)dlfilters
-	$(QUIET_CC)$(CC) -c -Iinclude -o $@ -fpic $<
+	$(QUIET_CC)$(CC) -c -Iinclude $(EXTRA_CFLAGS) -o $@ -fpic $<
 
 $(OUTPUT)dlfilters/%.so: $(OUTPUT)dlfilters/%.o
-	$(QUIET_LINK)$(CC) -shared -o $@ $<
+	$(QUIET_LINK)$(CC) $(EXTRA_CFLAGS) -shared -o $@ $<
 
 ifndef NO_JVMTI
 LIBJVMTI_IN := $(OUTPUT)jvmti/jvmti-in.o
reviewer Acked-by on v1 1/1
#1 lore raw
Quoted 16 lines · Arnaldo Carvalho de Melo

Hi Adrian,

I had to add this cset to fix the build/link on cross build
environments with a sysroot, like Android, EXTRA_CFLAGS is where it will get the needed --sysroot=/opt/android-ndk-r12b//platforms/android-24/arch-arm, please ack.

- Arnaldo

tools/perf/Makefile.perf +0 -0
index 24623599113df215..e04313c4d8409a94 100644
@@ -785,10 +785,10 @@ endif
 
 $(OUTPUT)dlfilters/%.o: dlfilters/%.c include/perf/perf_dlfilter.h

tools/perf/Makefile.perf endif · line 794

Quoted 10 lines
tools/perf/Makefile.perf +2 -2
 	$(Q)$(MKDIR) -p $(OUTPUT)dlfilters
-	$(QUIET_CC)$(CC) -c -Iinclude -o $@ -fpic $<
+	$(QUIET_CC)$(CC) -c -Iinclude $(EXTRA_CFLAGS) -o $@ -fpic $<
 
 $(OUTPUT)dlfilters/%.so: $(OUTPUT)dlfilters/%.o
-	$(QUIET_LINK)$(CC) -shared -o $@ $<
+	$(QUIET_LINK)$(CC) $(EXTRA_CFLAGS) -shared -o $@ $<
 
 ifndef NO_JVMTI
 LIBJVMTI_IN := $(OUTPUT)jvmti/jvmti-in.o