DMARC-Filter: OpenDMARC Filter v1.4.2 delorie.com 51BKxKnb489882 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 51BKxKnb489882 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=tA/4nKXi X-Recipient: archive-cygwin AT delorie DOT com DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6BCF43858C52 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com; s=default; t=1739307559; bh=INjcvbNOv6TZvUmWlQre99zv6u4dKKbLecnipNb+qlY=; h=Subject:In-Reply-To:Date:References:To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=tA/4nKXiDbKYkbmGEQYrNRp3jt9s2+gSu2HMjAj0dtlRBz7jZ6ydK0AVoLgzfbecH qwn4ZA+y4ckQLBSz8VB+RdWNR3mycCJNKXUD1iKpu5Btijb4X395ZvZqpwCzSZ47V+ Sc9nXxopJ7kavUHsmkRmEnPCUC3l8+uVsEmNrryE= X-Original-To: cygwin AT cygwin DOT com Delivered-To: cygwin AT cygwin DOT com DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 119843858C5F ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 119843858C5F ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1739307500; cv=none; b=L7UJwKgFHTs0JUqoGc2k7CSPEOXbCjzMLvBcEigrmiehKy8tDGOcPlS69ZTHc7GVSa4YtkKbnPmGtfIqmzOYwlRpuo+Ib1aDQe6tR9QgesoObrZZNBmcOjl1pP9hFI+ILO6RdKOVAJOoCnCiaQG28iW9Oh8SHuL2gj04v6vgbis= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1739307500; c=relaxed/simple; bh=ENuqzD8zVFwiVz3lPOcUNR6yTXcmpnAB1yUhO8Bi6rI=; h=DKIM-Signature:Mime-Version:Subject:From:Date:Message-Id:To; b=D47iEUsznXRbOGPid23GXcCZK88x8QHhu0Sf8yx1NOL9Noj1qQLITKEyt0Su/Duod2z/IG4IcYcsJ5ALn1IDt5GIDc/jMENynFqvWRiMiW1v9LFfIe1r9DckpiQdSBMz4pOaMCtAn4ApstrWNZAH9ZxkZCTd9VAn+k7Pqjmv86c= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 119843858C5F X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739307498; x=1739912298; 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=xIEWa+30WWjH8E06+s/5hulqahHz9iwN+XHWGdL4u2M=; b=vQFsrA8S84lc8tILs5j6S6czb8LHMWk++BRPp0WaIJ7k4HL1u+Z1a2FcLv1KhGX2PA GAaI84MyOe8D2HpbpXpueq7M8my8qFWiTtngG0P4xKhRHlKC3APcNdzphsj9zW8I5V1t SWKF3xrbo0G4iVavc8nM5Rk2ozEOeWJsX9SEZy1YFuuINfyaSnDz5DLt+Ij8vdx8Z8/K sbuKL0Vo7Lzp1YYNAAYDHSEoV7DphjrBQgnUo68s25yTcXyK8jLDeaq/Zj4oclBV94h2 QHAUemZi/wfXgawMoU7BNRtSsvx1tiDeZYxaqfdKjvEcLmJ11zmG2nOKSa9V+I5gub98 16tA== X-Gm-Message-State: AOJu0Yy2aNKwbOPEx6fxoYVPfO0Szo79icJ5yzyAyglD2BVwNye8qr5B dNyEElPRo+x75nhTWj0Xm40W8CHz67pFmdq43kh5TM8jFO6n7ILL6SSIkgrFZw1Vbr5QglZ4Wl4 KTj6+oQpPsybcDOys/ehvYFMlWKGtEffPyOPRfbGcb8pPrgE0ePP5WDsG0csinER4Tera4kwqOM uCZonSwUYI8qOzmKhLf3Wgg/rYqIGvNbPXhGXyJLF+meE= X-Gm-Gg: ASbGnctB4eJxmPobSPUU96SPIm7Ri3uvusLglhsTe3jTGReVuJI8L57M2aR6dIhn0dI mJcv6rJrjbRadx6okdlko8jpCfgRTC9GijBJg1iFirh2IojGwFIjZ1CM1y3JKGM24JJUobllJjY MBHVQm6/7AlTrIwD59UCopW5qfBlSYDN6Np835T+cPoDAunq5qiD4d8hyctPRxTSTmZARZq2aAW 8wCCD13BnVQ5uSlqhnbVEJ6jWHcgRtyA9eTaQ6yx4i4hkxMpzal5NWCp8yBPqHzZHJHjqv0/i6q /rp4bPmT43SSx9sKOWflSk74YhVIorH3Ivn+X4+Fq1r39LU3+M+7Ol1n9VU= X-Google-Smtp-Source: AGHT+IEvKz9u6BtoHmSkLgrfwOixicJhXbgR5kpi7bwZXznFJIC1+G7uudb6O0sO1nxDuS+DxiJNQw== X-Received: by 2002:a17:907:3f25:b0:ab7:e278:2955 with SMTP id a640c23a62f3a-ab7f34a31b8mr33566466b.38.1739307498513; Tue, 11 Feb 2025 12:58:18 -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: <6faedefc-eb17-4b02-89b9-44b73e82d43f@SystematicSW.ab.ca> Date: Tue, 11 Feb 2025 21:58:17 +0100 Message-Id: <0252F948-10C3-4B9E-943D-ACA35E190726@unified-streaming.com> References: <9c6a1ccc-d2fb-4aaf-b8c2-29574fa640b4 AT cornell DOT edu> <6faedefc-eb17-4b02-89b9-44b73e82d43f AT SystematicSW DOT ab DOT ca> To: The Cygwin Mailing List 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="utf-8" Errors-To: cygwin-bounces~archive-cygwin=delorie DOT com AT cygwin DOT com Sender: "Cygwin" Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by delorie.com id 51BKxKnb489882 It does not look like it's supported by Cygwin's gcc: $ gcc -v Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-cygwin/12/lto-wrapper.exe Target: x86_64-pc-cygwin Configured with: /mnt/share/cygpkgs/gcc/gcc.x86_64/src/gcc-12.4.0/configure --srcdir=/mnt/share/cygpkgs/gcc/gcc.x86_64/src/gcc-12.4.0 --prefix=/usr --exec-prefix=/usr --localstatedir=/var --sysconfdir=/etc --docdir=/usr/share/doc/gcc --htmldir=/usr/share/doc/gcc/html -C --build=x86_64-pc-cygwin --host=x86_64-pc-cygwin --target=x86_64-pc-cygwin --without-libiconv-prefix --without-libintl-prefix --libexecdir=/usr/lib --with-gcc-major-version-only --enable-shared --enable-shared-libgcc --enable-static --enable-version-specific-runtime-libs --enable-bootstrap --enable-__cxa_atexit --enable-clocale=newlib --with-dwarf2 --with-tune=generic --enable-languages=ada,c,c++,fortran,lto,objc,obj-c++,jit --enable-graphite --enable-threads=posix --enable-libatomic --enable-libgomp --enable-libquadmath --enable-libquadmath-support --disable-libssp --enable-libada --disable-symvers --disable-multilib --with-gnu-ld --with-gnu-as --with-cloog-include=/usr/include/cloog-isl --without-libiconv-prefix --without-libintl-prefix --with-system-zlib --enable-linker-build-id --with-default-libstdcxx-abi=gcc4-compatible --enable-libstdcxx-filesystem-ts Thread model: posix Supported LTO compression algorithms: zlib zstd gcc version 12.4.0 (GCC) $ cat test-builtin-thread-pointer.c void f(void) { void *p = __builtin_thread_pointer(); } $ gcc -c test-builtin-thread-pointer.c test-builtin-thread-pointer.c: In function ‘f’: test-builtin-thread-pointer.c:3:13: warning: implicit declaration of function ‘__builtin_thread_pointer’; did you mean ‘__builtin_extend_pointer’? [-Wimplicit-function-declaration] 3 | void *p = __builtin_thread_pointer(); | ^~~~~~~~~~~~~~~~~~~~~~~~ | __builtin_extend_pointer test-builtin-thread-pointer.c:3:13: warning: initialization of ‘void *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion] On Ubuntu 24.04 this program compiles without warnings. It looks like the gcc configure script checks for TLS here: https://gcc.gnu.org/git/?p=gcc.git;a=blob;f=gcc/configure.ac;h=8fab93c9365496062583c5bd8ace402c8a797817;hb=HEAD#l3846, by running some code through the assembler. I would guess that doesn't work on Cygwin. -Dimitry > On 11 Feb 2025, at 21:45, Brian Inglis via Cygwin wrote: > > > On 2025-02-11 12:41, Dimitry Andric via Cygwin wrote: >>> 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. > >> 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. > Does `info gcc tls` help and do we know if that is supported by our gcc(s)? > > -- > Take care. Thanks, Brian Inglis Calgary, Alberta, Canada > > La perfection est atteinte Perfection is achieved > non pas lorsqu'il n'y a plus rien à ajouter not when there is no more to add > mais lorsqu'il n'y a plus rien à retrancher but when there is no more to cut > -- Antoine de Saint-Exupéry > > -- > 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