DMARC-Filter: OpenDMARC Filter v1.4.2 delorie.com 51BJgXMr456954 Authentication-Results: delorie.com; dmarc=pass (p=none dis=none) header.from=cygwin.com Authentication-Results: delorie.com; spf=pass smtp.mailfrom=cygwin.com DKIM-Filter: OpenDKIM Filter v2.11.0 delorie.com 51BJgXMr456954 Authentication-Results: delorie.com; dkim=pass (1024-bit key, unprotected) header.d=cygwin.com header.i=@cygwin.com header.a=rsa-sha256 header.s=default header.b=XGu1SU0G X-Recipient: archive-cygwin AT delorie DOT com DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B4EEE3858D37 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com; s=default; t=1739302952; bh=O/trimcqSSv4RFxli0b8O+3gUgaRR1x02I9XXd82DIA=; h=Subject:In-Reply-To:Date:Cc:References:To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=XGu1SU0GE69Qy7GgwBVhpTviwJAJcUL1O603GWTc5WgEXcIX4pPmtpL+q1mrnh2/t AYY8vxNDlJIwEHl6okGL9+hm5D+EvN3s1O0oXkxSOiNak1tIcRnzduzBIf6wbZ1Yb/ fDWXf7WGIFSENKkqxfceLhmNZFpNtVwfJrpiblH8= X-Original-To: cygwin AT cygwin DOT com Delivered-To: cygwin AT cygwin DOT com DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 04F143858D33 ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 04F143858D33 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1739302890; cv=none; b=tDL8FHEBJWc3taOuo1Il416q+G7IPLDC+Up6XNvNJmmsEBYsSiffDDENUNZhoOvSK+iwZxTMzh42Rrleg6hrxjtOL89ilk0B2jJVLh3b0o5GcMB9jfQt5FFCdUPrkdH+GS8yNCldlYX8oioVlwgCACwYf/G7RmjMs0TRz4sVS4Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1739302890; c=relaxed/simple; bh=8LlqxVk+ghjfIt0KeW2t36Et+OG9QIAVFRuoKi0Cmis=; h=DKIM-Signature:Mime-Version:Subject:From:Date:Message-Id:To; b=CZDsT21SV3YjCcwiDioKbE5Nn84rFdm0zhSDQUzPdOBeHfMWlBOb+3EyJF8d20n+iZTbJSUywtzzVjpy78fvwie9YoX2Oxfnf/buq2pMS9NN+MLAXvKZfNdfLA0gqTXQ5ha001QVbtnvkQb2XeO1xHPTUXRQDmHkhCxDLD9bW6Q= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 04F143858D33 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739302888; x=1739907688; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=vwOR/44AS4DM/KGOvRFrYPjyn7QUqVgY8Nuy5e1rIk4=; b=Hhadqr40iPacHIl+fbh0tKfyKKAownyhzKgABzuWlzUAEtARz5ypxhGENPiTX1FCwZ FYvQAhOvMwvH44puEcOnbUBZXW1AXjERFTSPIMGZTlResIuD/nGXJ/a128sWiAMvXxP5 /Bk4fVxK6fcCdzTkB27/y7HwbdNoRSVOSnGRbGYLAB1ABhCDHRW4P8Bb0kVNccgruymE 56QtLgVKCl2z5iDV6eyzl8CveXxvgObfw3KO6J5iPR8lIR0cg50i3PrL6zz3SW0ccmA7 ZRCLZkbT9K/6txC43bdmxL8Kt0SAlLHhCIAnMv1sBcym+zF50ADgQq2lUf225om38y5g TVEQ== X-Gm-Message-State: AOJu0Yy79GbvHg+qBl84kneUlPtJBsseMVgN+VZSYwky+N0z2XWUmslI C6nLGOaIiD8jD8kxMibAIDKbtzMsQ3XBBw+nK99XMdyHEYk7uhxQBX5DhR0OxmU= X-Gm-Gg: ASbGncsyp30UQuwPYJjxRZOjGuGMBAadIdGQizXlypWmXKUoX7hTA3vKpYCHDVVLIsw YY/cVT4dEa5DqBi2Iz2l4GiLYDXpGr3U/ZEUgxyvmBTFEe/IRDifwxbRFGuMmbADBsa5eYyN6cO hK9wUsmmpc282gX6M2OWsaeUW5pNjdHG4+OJXCqIdR/hf8sRVRNFTbyQTpbj2PAAuqlBxBMKEv8 ngv0zWMjBe5tSP8t+rK0lbNZue9WOIHiucgUFAT4VrQWJkBfH5NqnFGo+mtkF/MWT7kVK5+x9XJ th8+7vinZHoqaSoOECzN7v7olNV9da2FWElhsPdQ9y3bw8DP4JZ4fx+ROGw= X-Google-Smtp-Source: AGHT+IFQE1zNcFs7YmLGUG7y+t+JUNuGw9zB8l5RyHm3Mzb9biZrCIljulEolPXJtq3GQgnC8l3kAQ== X-Received: by 2002:a17:907:c302:b0:ab6:c726:2843 with SMTP id a640c23a62f3a-ab7db59a996mr466027866b.22.1739302888411; Tue, 11 Feb 2025 11:41:28 -0800 (PST) Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.700.6.1.9\)) Subject: Re: __builtin_thread_pointer In-Reply-To: <9c6a1ccc-d2fb-4aaf-b8c2-29574fa640b4@cornell.edu> Date: Tue, 11 Feb 2025 20:41:27 +0100 Cc: The Cygwin Mailing List Message-Id: References: <9c6a1ccc-d2fb-4aaf-b8c2-29574fa640b4 AT cornell DOT edu> To: Ken Brown X-Mailer: Apple Mail (2.3731.700.6.1.9) X-BeenThere: cygwin AT cygwin DOT com X-Mailman-Version: 2.1.30 Precedence: list List-Id: General Cygwin discussions and problem reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Dimitry Andric via Cygwin Reply-To: Dimitry Andric Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: cygwin-bounces~archive-cygwin=delorie DOT com AT cygwin DOT com Sender: "Cygwin" It's a gcc builtin function, not something implemented in an external library. Therefore, there is no linker option that can fix this. Also, as far as I can see from gcc's documentation, __builtin_thread_pointer() is only supported for the RISCV and SH architectures. Then again, gcc's implementation seems to hinge this on whether the platform supports TLS or not. In any case, it is probably better to not use this function if your gcc does not support it. -Dimitry > On 11 Feb 2025, at 20:26, Ken Brown via Cygwin wrote: > > Does Cygwin support __builtin_thread_pointer? I'm guessing not, because I'm getting a link error (undefined reference to `__builtin_thread_pointer') when I try to build some software that uses it. Or is there something that would have to be added to the link command line? The full command line and error message are quoted below, in case anyone spots something obvious. > > Ken > > [242/242] Linking C executable luametatex.exe > FAILED: luametatex.exe > : && /usr/bin/gcc.exe -ggdb -O2 -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=3 -fstack-protector-strong --param=ssp-buffer-size=4 -ffile-prefix-map=/home/kbrown/src/cygluametatex/luametatex-2.11.05-1.x86_64/build=/usr/src/debug/luametatex-2.11.05-1 -ffile-prefix-map=/home/kbrown/src/cygluametatex/luametatex-2.11.05-1.x86_64/src/luametatex=/usr/src/debug/luametatex-2.11.05-1 -O2 -g -DNDEBUG -s CMakeFiles/luametatex.dir/source/luametatex.c.o -o luametatex.exe -Wl,--out-implib,libluametatex.dll.a -Wl,--major-image-version,0,--minor-image-version,0 libtex.a liblua.a libmp.a libluarest.a libluasocket.a libluaoptional.a libpplib.a libminiz.a libsoftposit.a libpotrace.a -ldl libmimalloc.a -lpthread -lm && /bin/sh CMakeFiles/luametatex.dir/post-build.sh 7847d1a259c666c4 > /usr/lib/gcc/x86_64-pc-cygwin/12/../../../../x86_64-pc-cygwin/bin/ld: libmimalloc.a(alloc.c.o): in function `_mi_prim_thread_id': > /usr/src/debug/luametatex-2.11.05-1/source/libraries/mimalloc/include/mimalloc/prim.h:251:(.text+0x187): undefined reference to `__builtin_thread_pointer' > /usr/lib/gcc/x86_64-pc-cygwin/12/../../../../x86_64-pc-cygwin/bin/ld: /usr/src/debug/luametatex-2.11.05-1/source/libraries/mimalloc/include/mimalloc/prim.h:251:(.text+0x437): undefined reference to `__builtin_thread_pointer' > /usr/lib/gcc/x86_64-pc-cygwin/12/../../../../x86_64-pc-cygwin/bin/ld: /usr/src/debug/luametatex-2.11.05-1/source/libraries/mimalloc/include/mimalloc/prim.h:251:(.text+0x4e7): undefined reference to `__builtin_thread_pointer' > /usr/lib/gcc/x86_64-pc-cygwin/12/../../../../x86_64-pc-cygwin/bin/ld: libmimalloc.a(alloc.c.o):/usr/src/debug/luametatex-2.11.05-1/source/libraries/mimalloc/src/free.c:340:(.text+0x597): undefined reference to `__builtin_thread_pointer' > /usr/lib/gcc/x86_64-pc-cygwin/12/../../../../x86_64-pc-cygwin/bin/ld: libmimalloc.a(init.c.o): in function `_mi_prim_thread_id': > /usr/src/debug/luametatex-2.11.05-1/source/libraries/mimalloc/include/mimalloc/prim.h:251:(.text+0xd1): undefined reference to `__builtin_thread_pointer' > /usr/lib/gcc/x86_64-pc-cygwin/12/../../../../x86_64-pc-cygwin/bin/ld: libmimalloc.a(init.c.o):/usr/src/debug/luametatex-2.11.05-1/source/libraries/mimalloc/include/mimalloc/prim.h:251: more undefined references to `__builtin_thread_pointer' follow > collect2: error: ld returned 1 exit status > > -- > Problem reports: https://cygwin.com/problems.html > FAQ: https://cygwin.com/faq/ > Documentation: https://cygwin.com/docs.html > Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple -- Problem reports: https://cygwin.com/problems.html FAQ: https://cygwin.com/faq/ Documentation: https://cygwin.com/docs.html Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple