From unknown Tue Sep 09 00:07:22 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#59967 <59967@debbugs.gnu.org> To: bug#59967 <59967@debbugs.gnu.org> Subject: Status: Fix missing -fPIC parameter when compiling tree-sitter module Reply-To: bug#59967 <59967@debbugs.gnu.org> Date: Tue, 09 Sep 2025 07:07:22 +0000 retitle 59967 Fix missing -fPIC parameter when compiling tree-sitter module reassign 59967 emacs submitter 59967 lux severity 59967 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 11 10:36:12 2022 Received: (at submit) by debbugs.gnu.org; 11 Dec 2022 15:36:12 +0000 Received: from localhost ([127.0.0.1]:46667 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p4ON9-0005fn-Ka for submit@debbugs.gnu.org; Sun, 11 Dec 2022 10:36:11 -0500 Received: from lists.gnu.org ([209.51.188.17]:47110) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p4ON7-0005fh-6r for submit@debbugs.gnu.org; Sun, 11 Dec 2022 10:36:09 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p4ON7-0001da-0l for bug-gnu-emacs@gnu.org; Sun, 11 Dec 2022 10:36:09 -0500 Received: from out162-62-57-137.mail.qq.com ([162.62.57.137]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p4ON2-0004le-RO for bug-gnu-emacs@gnu.org; Sun, 11 Dec 2022 10:36:08 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qq.com; s=s201512; t=1670772957; bh=2u1N3FVeYljPgQNQtlCRALU5kxLBKfAm42Dr4AJNefU=; h=Date:From:To:Subject; b=ulCUiwtjrl28UkQHkNf7c4f/pKCv5BFPEZNdoFV1qbL07LCtTdCJI2fxVMUDvfY74 SfKQic7kIzceoyRjc15bEcfyVFN24CUCPOSq7TpfRh2ES86bAwD09lOfDV5tGmdnnl IS57gdNFDoR9eycPiCHo6nPbQjT5cL2JAywbzBjo= Received: from lx-pc ([240e:399:e6f:ee32:f815:4044:ba50:97f9]) by newxmesmtplogicsvrszb1-0.qq.com (NewEsmtp) with SMTP id 8F81A6E8; Sun, 11 Dec 2022 23:35:56 +0800 X-QQ-mid: xmsmtpt1670772956tk7za2dek Message-ID: X-QQ-XMAILINFO: OC704IrkdJt6SW2AQ2ie7GpF5AqTmxYHB0baMIJDkuwMXejgYGTNEmrA93xvT8 9CtAiUMPjBZl6oGtrBwK5x6AoRGtzVYvKoZ0mWbhkqR2//JiVK6RahZko69tdifq49f5UsFhczP8 uVY82tGl2CQTH47OE9ZNFsL1XQoJWr65GnJSiwZsDgbQ/eTCuijB3Sco3gAUJ9n6AojWAACKoA2C EyZAXfhJ1VQ5oqpP/kUWp6aPc2QouhOJCrXysdUtSpnc3mWFGeGRp8n59vtKvMlHe/tjPfLWKnIR aK0qqdDfDbxsL6xsfVr17DxYMET4ux5phJGp7Es2Qz0v1clSTyqqTnTzK2TYqF3PNwlX1nitx7vg CujDSEeVzJg2QtfCIRpsjpM68l5RqaXMushomZOv3auVK/p09bhnfyHjXQBn/D3E7/Dm8ugET98b s+FwvGT/4OTo0iS3oTMvjIjdo0Npci6ceh+2akZTkRiwcuoqQOkFxoGyf08pqPcPpC9cNykrDC06 5ZzsHf530XXzPAOKME8wQOtiJf3kZBCZwDRoVdMGbxkQZuxy5695klzbYDO7o6bw7yHGk1ehCwcJ LSxkYe5SQIQlfG5ikT0J4VXm6VvGBRaqcnoPg2BEgGPPKsxP0ULBIn667hnZaCRwJCOAtsj40h7o SKLx9P/vQgb/srhxpPSCnIS+tSCQTPMDS4NRoMJYB+0LzEtVVMSb1fw4kMAgIFCJJAaL0WNGY2hh jw2J9lf/T6clGT7dxU3CU2oIY+K6gTqDKmR9KSLnA/zVSCxx36iK1TrjNP8Fnk4NJjh0/XA05UC0 ndfdWuV6khgB5bO0tzes5zIzbNcdJER8LEOhNJKGfcbff0uHfjFNoSZgOft2y/q5OEe6OH3Evnm7 V/ij+a2f454bf1hxLkXp19a09cQ8q9F4n2GHXqh+W8L9bd8SzsXQLc0ucDnn+G2Y6M6xTw87Tkth 4bBefU/mN7NirTzQlNFzF2oCsQU364d5XEMvJanyR66DcRKnpX+A== Date: Sun, 11 Dec 2022 23:35:53 +0800 From: lux To: "bug-gnu-emacs@gnu.org" Subject: Fix missing -fPIC parameter when compiling tree-sitter module X-OQ-MSGID: <20221211233553.100133b5@lx-pc> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.35; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_/c+Dkrbiz+uzgSnzioQApcOX" Received-SPF: none client-ip=162.62.57.137; envelope-from=lx@shellcodes.org; helo=out162-62-57-137.mail.qq.com X-Spam_score_int: 10 X-Spam_score: 1.0 X-Spam_bar: + X-Spam_report: (1.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HELO_DYNAMIC_IPADDR=1.951, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, RDNS_DYNAMIC=0.982, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) --MP_/c+Dkrbiz+uzgSnzioQApcOX Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline GCC in Fedora Linux does not use --enable-default-pie by default, so I will encounter the following errors when running the build.sh: $ ./build.sh c Building c /usr/bin/ld: parser.o: relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: failed to set dynamic section sizes: bad value collect2: error: ld returned 1 exit status cp: cannot stat 'libtree-sitter-c.so': No such file or directory Following are my gcc configure information: $ gcc -v Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/12/lto-wrapper OFFLOAD_TARGET_NAMES=nvptx-none OFFLOAD_TARGET_DEFAULT=1 Target: x86_64-redhat-linux Configured with: ../configure --enable-bootstrap --enable-languages=c,c++,fortran,objc,obj-c++,ada,go,d,lto --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-gcc-major-version-only --enable-libstdcxx-backtrace --with-linker-hash-style=gnu --enable-plugin --enable-initfini-array --with-isl=/builddir/build/BUILD/gcc-12.2.1-20221121/obj-x86_64-redhat-linux/isl-install --enable-offload-targets=nvptx-none --without-cuda-driver --enable-offload-defaulted --enable-gnu-indirect-function --enable-cet --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux --with-build-config=bootstrap-lto --enable-link-serialization=1 Thread model: posix Supported LTO compression algorithms: zlib zstd gcc version 12.2.1 20221121 (Red Hat 12.2.1-4) (GCC) I added -fPIC option in build.sh. --MP_/c+Dkrbiz+uzgSnzioQApcOX Content-Type: text/x-patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=0001-admin-notes-tree-sitter-build-module-build.sh-Add-fP.patch >From 188f05e4f8fb7834ee6f43dd00bc59cfe39fc55b Mon Sep 17 00:00:00 2001 From: lu4nx Date: Sun, 11 Dec 2022 23:33:33 +0800 Subject: [PATCH] ; * admin/notes/tree-sitter/build-module/build.sh: Add -fPIC --- admin/notes/tree-sitter/build-module/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/admin/notes/tree-sitter/build-module/build.sh b/admin/notes/tree-sitter/build-module/build.sh index cc31e3f6f0..c1e81f93ed 100755 --- a/admin/notes/tree-sitter/build-module/build.sh +++ b/admin/notes/tree-sitter/build-module/build.sh @@ -43,7 +43,7 @@ grammardir= ### Build -cc -c -I. parser.c +cc -fPIC -c -I. parser.c # Compile scanner.c. if test -f scanner.c then -- 2.38.1 --MP_/c+Dkrbiz+uzgSnzioQApcOX-- From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 12 17:42:30 2022 Received: (at 59967-done) by debbugs.gnu.org; 12 Dec 2022 22:42:30 +0000 Received: from localhost ([127.0.0.1]:55895 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p4rVG-0005EX-A9 for submit@debbugs.gnu.org; Mon, 12 Dec 2022 17:42:30 -0500 Received: from mail-pj1-f49.google.com ([209.85.216.49]:51833) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p4rVE-0005EN-JL for 59967-done@debbugs.gnu.org; Mon, 12 Dec 2022 17:42:29 -0500 Received: by mail-pj1-f49.google.com with SMTP id gt4so1401668pjb.1 for <59967-done@debbugs.gnu.org>; Mon, 12 Dec 2022 14:42:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:cc:date:message-id:subject:mime-version :content-transfer-encoding:from:from:to:cc:subject:date:message-id :reply-to; bh=BdujKC7SPRUoMctNKHkVIFWgGzYRnFXoAvUiEsV4C3k=; b=DPxdUrVxQDmYdSgyokq2FWRTuQmOn0QF5ofehicvWlNcB0dIhEzcaMq/XsygEZO37z L+STPit0lo+lS9TZqBCrnN86w6PO+LRPeXzSro1bFXRo9VNkNFbk2XXeYUd8UKLhgKCB qltB0zAe2t5jorW1CVGZ8+boFDMxWlLBzIFjV0c7YiFPZNxC6EcfbBD3ZZb5RFwSMMCm MRlVoR+sp6/VLL49bTy/Wmka5F6szF4cSqCi+GDgK6q2Nh0PQvXPQXWCgy2SIccJ63Sc oupaie1Iy6+bmE4q1/nZ15w7CLW3eh2Xn27B0TI+I0ncfrz9l4ZYhzHN6dH+iOrWGtXt E04w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:cc:date:message-id:subject:mime-version :content-transfer-encoding:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=BdujKC7SPRUoMctNKHkVIFWgGzYRnFXoAvUiEsV4C3k=; b=niPvF3179p4IVuMccOD4VHp6eTTo1PvQRudbO+yJLt2fC3dMKCvsmAC+616DM0/j/w d3O/+dL4vVTOZhO01ihcaVFdT7lRpa3oqhofnghF62e4dsaSXrnve28qDvHAZslqdHLZ H2JevzEOpjGkSOcOM8PPGHqFqP3ubEeXA2ZTfFR3Ao3Hy6MOkdNzr7stoCEegg6nLhex 6MVf++RUx8E9P7OQh/7Glhy5Zxd2Zr9/0xGjIPwwgtmLtgWTr9TYsS/aXjz8+iu/Bbox iJ9pzr+iyO2AeVCj9xzmTdGXgZXH/eQU229r2E+i/nECeQDc4I0ehPkqjw8M2YPOae6o WGAQ== X-Gm-Message-State: ANoB5pk8DDZ8rfbFjEWBpUXv4aPXBB63Z5RHuvvXYoO2gYXPmPh5wzOL oQu8kgsZqQbcaZY1uDew0w0= X-Google-Smtp-Source: AA0mqf56SkJzKkfUczWVUSszJR47dr93DseSqXHUiz5HnPwfdou510dlYZjPuspiBxcEtUFxr23ECQ== X-Received: by 2002:a17:90a:6506:b0:214:222:6ed3 with SMTP id i6-20020a17090a650600b0021402226ed3mr18718563pjj.43.1670884942809; Mon, 12 Dec 2022 14:42:22 -0800 (PST) Received: from smtpclient.apple (cpe-172-117-161-177.socal.res.rr.com. [172.117.161.177]) by smtp.gmail.com with ESMTPSA id u6-20020a17090a1f0600b0020647f279fbsm5946905pja.29.2022.12.12.14.42.21 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 12 Dec 2022 14:42:22 -0800 (PST) From: Yuan Fu Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) Subject: Re: bug#59967: Fix missing -fPIC parameter when compiling tree-sitter module Message-Id: Date: Mon, 12 Dec 2022 14:42:20 -0800 To: lx@shellcodes.org X-Mailer: Apple Mail (2.3696.120.41.1.1) X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 59967-done Cc: 59967-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) lux writes: > GCC in Fedora Linux does not use --enable-default-pie by default, so > I will encounter the following errors when running the build.sh: > > > $ ./build.sh c =20 > Building c > /usr/bin/ld: parser.o: relocation R_X86_64_32S against `.rodata' can > not be used when making a shared object; recompile with -fPIC > /usr/bin/ld: failed to set dynamic section sizes: bad value collect2: > error: ld returned 1 exit status cp: cannot stat = 'libtree-sitter-c.so': > No such file or directory > > Following are my gcc configure information: > > $ gcc -v > Using built-in specs. > COLLECT_GCC=3Dgcc > = COLLECT_LTO_WRAPPER=3D/usr/libexec/gcc/x86_64-redhat-linux/12/lto-wrapper > OFFLOAD_TARGET_NAMES=3Dnvptx-none > OFFLOAD_TARGET_DEFAULT=3D1 > Target: x86_64-redhat-linux > Configured with: ../configure --enable-bootstrap > --enable-languages=3Dc,c++,fortran,objc,obj-c++,ada,go,d,lto > --prefix=3D/usr --mandir=3D/usr/share/man --infodir=3D/usr/share/info > --with-bugurl=3Dhttp://bugzilla.redhat.com/bugzilla --enable-shared > --enable-threads=3Dposix --enable-checking=3Drelease --enable-multilib > --with-system-zlib --enable-__cxa_atexit = --disable-libunwind-exceptions > --enable-gnu-unique-object --enable-linker-build-id > --with-gcc-major-version-only --enable-libstdcxx-backtrace > --with-linker-hash-style=3Dgnu --enable-plugin --enable-initfini-array > = --with-isl=3D/builddir/build/BUILD/gcc-12.2.1-20221121/obj-x86_64-redhat-l= inux/isl-install > --enable-offload-targets=3Dnvptx-none --without-cuda-driver > --enable-offload-defaulted --enable-gnu-indirect-function --enable-cet > --with-tune=3Dgeneric --with-arch_32=3Di686 = --build=3Dx86_64-redhat-linux > --with-build-config=3Dbootstrap-lto --enable-link-serialization=3D1 = Thread > model: posix Supported LTO compression algorithms: zlib zstd gcc > version 12.2.1 20221121 (Red Hat 12.2.1-4) (GCC)=20 > > I added -fPIC option in build.sh. Ah, yes, thank you! I applied the patch. Yuan From unknown Tue Sep 09 00:07:22 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 10 Jan 2023 12:24:12 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator