From mboxrd@z Thu Jan 1 00:00:00 1970 From: Arnaldo Carvalho de Melo Subject: [PATCH 05/31] perf jvmti: Link against tools/lib/string.o to have weak strlcpy() Date: Fri, 20 Sep 2019 11:25:16 -0300 Message-ID: <20190920142542.12047-6-acme@kernel.org> References: <20190920142542.12047-1-acme@kernel.org> Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Return-path: In-Reply-To: <20190920142542.12047-1-acme@kernel.org> Sender: linux-kernel-owner@vger.kernel.org To: Ingo Molnar , Thomas Gleixner Cc: Jiri Olsa , Namhyung Kim , Clark Williams , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, Arnaldo Carvalho de Melo , Thomas Richter , Adrian Hunter , Andreas Krebbel , Sergey Melnikov List-Id: linux-perf-users.vger.kernel.org From: Arnaldo Carvalho de Melo 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. Reported-by: Thomas Richter Cc: Adrian Hunter Cc: Andreas Krebbel Cc: Jiri Olsa Cc: Namhyung Kim Cc: Sergey Melnikov Link: https://lkml.kernel.org/n/tip-x8vg9sffgb2t1tzqmhkrulh7@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/jvmti/Build | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tools/perf/jvmti/Build b/tools/perf/jvmti/Build index eaeb8cb5379b..1e148bbdf820 100644 --- a/tools/perf/jvmti/Build +++ b/tools/perf/jvmti/Build @@ -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) -- 2.21.0