From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ej1-f47.google.com (mail-ej1-f47.google.com [209.85.218.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AAC403DB314 for ; Wed, 10 Jun 2026 13:39:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.47 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781098756; cv=none; b=DZsXeO1WrdAKT+kcS7ZOQmVxHlZMAZdu32ssysD/TvHzNROVaGEduwMAQ4cMCT487nQYQekFokHJVwBoaIhSnVCWSVr/cNqT2Oro5IkT/tpMtSmQ+EnzqIs/bZmxHjReVa26nl+6Se9SnLvXKNE3YNcxTSp7pg1OvPSmvjfr2n8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781098756; c=relaxed/simple; bh=N00Ky+WGYp84SzDMbu+B9refsaRvWDuX8zkxZe2IH6k=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=ofw+QG5THwPBQXtOP5ARi6TmBQRRpe5m8mJbyWUSVbzcgdHYkorXAh83g3MR5REJ5Yt+HS5vhnMBPjzCnLr24DDBwPODkctCEPsiOhGo3RfdGFNIasTbJzuXK1w38ETpDThAVEcxeO4WTuNVSTYg2sjVacd8htHw21ffYvRWefE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=hyi9U7hf; arc=none smtp.client-ip=209.85.218.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="hyi9U7hf" Received: by mail-ej1-f47.google.com with SMTP id a640c23a62f3a-bef8b97655eso1211937866b.0 for ; Wed, 10 Jun 2026 06:39:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1781098753; x=1781703553; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=PPHRXTOIn1D18o4cjb2DkZuJ0R5woSyQD9xCP2gFXJ8=; b=hyi9U7hfgZolEYgEQ3Jwq17irQMB/0NlS0TnZBiMuQkw4oQu3UIFLcbcTtGw7uItpb xemNm1mCVVLkjCIl7gz0BA843mGaTmbZB+pjs0rPvEefU6PQcsJAzP90ZIS7e53NMWNO 2kBpLuAfiuO4BvpX2TNhHliiO2MB4YAnBPFIE+hSwHFJDsC7NAsGTG4rCX3JBVDanD7p 5k4SYjtnjEzV0DlPfMsoh6OLnGuSsCd1MXMBu6CCmOkXiFIa41421N0UPPj3+pF3NpeI 9TCDQUVI2Nrr7OMGPPW1siTU/TOi6cilxRsbMZZgPhYCtdRHWh6Tqp19XJY79MHmzVSY 6Kqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781098753; x=1781703553; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=PPHRXTOIn1D18o4cjb2DkZuJ0R5woSyQD9xCP2gFXJ8=; b=ceZwocdyhqAs3ErmLgjOzbZzxn6gxJ+iwk+osWGGC6ZO/uvWXlsUstr68RRCdTbEOj M2cOeMxgJ2UuHRBnaWJt7MaM7f9C6AXm5KKz+cP8MqffcVIs8wmYT81LIR5d/Cl8LxMa +drPYwkevokax+XHT/FGQmpD2Z4U68SimaEzPIk5gQCWL/VKfqMaPdchZ258C5vhs8X7 Ufa/4jXOXmCHaczKnDpnS/YcbfeRDBGROIzWKuDqecpU4uyMEos2d3EkaqkFa/PCb1J1 cwNsz4pxVeIAf63CBfwe+m3pp7CPbNtWY8dWBb6bg+4lY04c2DuvTljZ2svi5dGiobA2 lbPg== X-Forwarded-Encrypted: i=1; AFNElJ/Oens+ffF1QFfLFPEwt45GYoGKGLsE9aEnJZF9a/oFZYIy70VZb1SyK8d4jcrQ0uCoqNktssHRlVnq+54=@vger.kernel.org X-Gm-Message-State: AOJu0YxPgPBhJgH+x6WCv0wl0bKVNpc26lVVfrdM2MnXb1XPvzF7aoY3 rFGLzxS5m6TQs73PTe7PTg/9eMOX+rJyhGHcih/NMnVp6WQWofAgLw4sSDBKn3RLBiA= X-Gm-Gg: Acq92OEuJiwKopJCuzFnmkg3ovUxTjuLZqry9UUgXyXRznjSsb3xKKqXEWSHTYlDdsd HxlYpEoWCoUg8h5JkmEcChRjEAQHk05jYI3q6Yc2WSEDahuokjrqyt7kB3k+pUxY5PNHxgAatpT ojI8+AjGBchLuHaS5kHTWxi+CvUubVVbGirVfs8jYXTJf9lGzSDEuBNMlUgVLecO1EWsVYYfJGg XkYqnIpspBVAvN5F3CUKE4Rk/++uYtcGolxf5SQd8u+ipTiv83jmHsUtwaokGDT2rbWC98nW3wz +V3ip7IDMH1EPNQxpvce/vs6tqW07PQ+6qJMiUxCzucM+br0ZhnADYfgvC0KjqYa13LkyRIiC3C Nm3kaW+Nm9esIkYbfu+C0bkIvtfYDw+zbSClmz78h1LOEhbJMpj2E7UnZRSUTutPJ6El1B1gd/D Y7E/Niw4WmAVHDFL7hG19oLHeL1VpK96rc2O1PCAI= X-Received: by 2002:a17:907:60d1:b0:bd8:fc89:cda0 with SMTP id a640c23a62f3a-bf3a8a0cdbamr1035525466b.24.1781098752912; Wed, 10 Jun 2026 06:39:12 -0700 (PDT) Received: from [192.168.1.3] ([185.48.77.170]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-bf054e04a89sm1179772566b.41.2026.06.10.06.39.11 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 10 Jun 2026 06:39:12 -0700 (PDT) Message-ID: Date: Wed, 10 Jun 2026 14:39:10 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] perf s390: Fix TEXTREL in Python extension by compiling as PIC To: Jens Remus Cc: Jan Polensky , Thomas Richter , Hendrik Brueckner , Heiko Carstens , linux-s390@vger.kernel.org, Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , Nathan Chancellor , Nick Desaulniers , Bill Wendling , Justin Stitt , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev References: <20260610112451.1553054-1-jremus@linux.ibm.com> Content-Language: en-US From: James Clark In-Reply-To: <20260610112451.1553054-1-jremus@linux.ibm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 10/06/2026 12:24 pm, Jens Remus wrote: > On s390 the Python extension build fails as follows when using a linker > that is configured to treat text relocations (TEXTREL) in shared > libraries as error by default: > > GEN python/perf.cpython-314-s390x-linux-gnu.so > /usr/bin/ld.bfd: error: read-only segment has dynamic relocations > > This occurrs because util/llvm-c-helpers.o is erroneously built from > util/llvm-c-helpers.cpp without compiler option -fPIC but linked into > the shared library (via libperf-util.a(perf-util-in.o)). > > On s390, object files must be compiled as position-indepedent code (PIC) > in order to be linked into shared libraries. Commit a9a3f1d18a6c ("perf > s390: Always build with -fPIC") added compiler option -fPIC to CFLAGS > for s390, which is used in C compiles. Add -fPIC to CXXFLAGS for s390 > as well, so that it is also used in C++ compiles. > > Reported-by: Thomas Richter > Signed-off-by: Jens Remus > --- > > Notes (jremus): > This patch applies on top of the perf-tools-next tree: > > git://git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools-next.git master > > Note that this resolves the issue discussed in thread "[PATCH 1/1] perf > build: Fix Python extension build with GCC 16 hardening": > https://lore.kernel.org/all/ahV2XGx_6h7upuc3@li-276bd24c-2dcc-11b2-a85c-945b6f05615c.ibm.com/T/ > > tools/perf/Makefile.config | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config > index 333ddd0e4bd8..33f90968c8a9 100644 > --- a/tools/perf/Makefile.config > +++ b/tools/perf/Makefile.config > @@ -109,6 +109,7 @@ endif > > ifeq ($(ARCH),s390) > CFLAGS += -fPIC > + CXXFLAGS += -fPIC > endif > > ifeq ($(ARCH),mips) Reviewed-by: James Clark