Skip to contentSkip to conversation

perf jvmti: Link against tools/lib/string.o to have weak strlcpy()

tip: perf/urgent tip-bot2 for Arnaldo Carvalho de Melo 1 participant 1 message Sep 20, 2019 1 message not in the archive perf events

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

tip-bot2 for Arnaldo Carvalho de Melo

author merge bot Applied
#1 lore raw

The following commit has been merged into the perf/urgent branch of tip:

Commit-ID:     79743bc927f695e5a24f26c31cfe2d69f6ee00f7
Gitweb:        https://git.kernel.org/tip/79743bc927f695e5a24f26c31cfe2d69f6ee00f7
Author:        Arnaldo Carvalho de Melo <[email protected]>
AuthorDate:    Mon, 02 Sep 2019 15:37:21 -03:00
Committer:     Arnaldo Carvalho de Melo <[email protected]>
CommitterDate: Fri, 20 Sep 2019 09:18:45 -03:00

perf jvmti: Link against tools/lib/string.o to have weak strlcpy()

That is needed in systems such some S/390 distros.

  $ readelf -s /tmp/build/perf/jvmti/jvmti-in.o | grep strlcpy
	452: 0000000000002990   125 FUNC    WEAK   DEFAULT  119 strlcpy
  $

Thanks to Jiri Olsa for fixing up my initial stab at this, I forgot how Makefiles are picky about spaces versus tabs.

---
 tools/perf/jvmti/Build |  9 +++++++++
 1 file changed, 9 insertions(+)
tools/perf/jvmti/Build +9 -0
index eaeb8cb..1e148bb 100644
@@ -1,8 +1,17 @@
 jvmti-y += libjvmti.o
 jvmti-y += jvmti_agent.o
 
+# For strlcpy
+jvmti-y += libstring.o
+
 CFLAGS_jvmti         = -fPIC -DPIC -I$(JDIR)/include -I$(JDIR)/include/linux
 CFLAGS_REMOVE_jvmti  = -Wmissing-declarations
 CFLAGS_REMOVE_jvmti += -Wstrict-prototypes
 CFLAGS_REMOVE_jvmti += -Wextra
 CFLAGS_REMOVE_jvmti += -Wwrite-strings
+
+CFLAGS_libstring.o += -Wno-unused-parameter -DETC_PERFCONFIG="BUILD_STR($(ETC_PERFCONFIG_SQ))"
+
+$(OUTPUT)jvmti/libstring.o: ../lib/string.c FORCE
+	$(call rule_mkdir)
+	$(call if_changed_dep,cc_o_c)