From patchwork Tue Dec 1 19:30:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabrice Fontaine X-Patchwork-Id: 1409024 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.133; helo=hemlock.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=qlu3Oru3; dkim-atps=neutral Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4ClsjJ6r75z9s0b for ; Wed, 2 Dec 2020 06:33:56 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id F19D08763D; Tue, 1 Dec 2020 19:33:51 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id N6vZqFy7zZ2i; Tue, 1 Dec 2020 19:33:48 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id C16258766C; Tue, 1 Dec 2020 19:33:47 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 386271BF39C for ; Tue, 1 Dec 2020 19:33:46 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 327B287110 for ; Tue, 1 Dec 2020 19:33:46 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id e0mRizSCJwMn for ; Tue, 1 Dec 2020 19:33:45 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.45]) by whitealder.osuosl.org (Postfix) with ESMTPS id 4055D870EC for ; Tue, 1 Dec 2020 19:33:45 +0000 (UTC) Received: by mail-wr1-f45.google.com with SMTP id u12so4562519wrt.0 for ; Tue, 01 Dec 2020 11:33:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=tpg7thOccTb1CAOEymzK9dRAsy9W8ielho3qRGbfJQc=; b=qlu3Oru3YoxocpKmxNrRTkUvW+3wPDUkSQxxi66qU9ipaxIuciqXNfM+7NryA636pa nkOIudp1rWjgcDvlfKnX+ouM7GmrdE4QbVYiuE6gjxxW+thB7ugneC3CAYryzBZSgTYx IP2Vi/z7+E2K7W97nAp+8wSlf9/AXSj+p2VFp+G4zzr6bgzpgpamO/CDFLH+GCCPV07k izBn4cGfxKskbdjgtU9MIXRG1cVeKtfsjtbRRmzO8OvVgOTT1faJKVXE7YQiefYhmRvW DwRiAEegI+juKNWo53HeKVyapwJCq0aL+asMVlUoPuVY0n2RmhpB7LvQubX1pLLQB3Y7 iSew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=tpg7thOccTb1CAOEymzK9dRAsy9W8ielho3qRGbfJQc=; b=APEWEfYpldgML/wwMUVHXyf/EXWzyQqfPtkBmIBNGrt2uNPNhVhGpa2l8Tdkdj9qF9 ePuUO5E6p3NJk9AdBx7ZBiMGn0qDvTJMmfun29+EXNdoBl69ichlVtDe4zLnOCjf8Hlt qTRdgAJK1GmSTSvKIuWZpBHz3UE56i8ClHK1GvEBTYjeyo/GpR4BriZUtNmHGHeXOuPS CqBIQyCFCzVVbKkOYFkEsqeVLVnX7pvYsyg03kemcn1A4DH5dlVN7qmvb6+GTmrKQGZe grwWt5UEXOwdC2ys4DcC0K9VdM4Nl+P280JSVD4uhQUclHy/nzb3QxzKQ4Nad32l8bev gMfQ== X-Gm-Message-State: AOAM533cPkol2o7/C/R6bFAVCSxQDLKe1FFAKjD8GGemDF4bx9nq/VSf wkE72FeFJ5jaTD2towPjS1+X+7OII/Yq1A== X-Google-Smtp-Source: ABdhPJxVS2YA/+L8qrvW/8vinBOzDucp7XscY8wfkI/moRrJ5Qtx+N49oc1Cdg+QugIeZN1gqkil4A== X-Received: by 2002:adf:e788:: with SMTP id n8mr5966024wrm.84.1606851223240; Tue, 01 Dec 2020 11:33:43 -0800 (PST) Received: from kali.home (2a01cb0881b76d00c2afd0dfa851d2b9.ipv6.abo.wanadoo.fr. [2a01:cb08:81b7:6d00:c2af:d0df:a851:d2b9]) by smtp.gmail.com with ESMTPSA id f17sm1179072wmh.10.2020.12.01.11.33.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Dec 2020 11:33:42 -0800 (PST) From: Fabrice Fontaine To: buildroot@buildroot.org Date: Tue, 1 Dec 2020 20:30:57 +0100 Message-Id: <20201201193057.403392-1-fontaine.fabrice@gmail.com> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Subject: [Buildroot] [PATCH 1/1] package/uclibc-ng-test: fix TLS for nios2 X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fabrice Fontaine Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Fix TLS for nios2 to avoid the following build failure: In file included from tst-tls1.c:6: tls-macros.h:101:3: error: #error "No support for this architecture so far." # error "No support for this architecture so far." ^~~~~ Fixes: - http://autobuild.buildroot.org/results/303e50d996b7261896f163418831fabb40779ff5 Signed-off-by: Fabrice Fontaine --- ...0001-add-nios2-tls-macros-from-glibc.patch | 84 +++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 package/uclibc-ng-test/0001-add-nios2-tls-macros-from-glibc.patch diff --git a/package/uclibc-ng-test/0001-add-nios2-tls-macros-from-glibc.patch b/package/uclibc-ng-test/0001-add-nios2-tls-macros-from-glibc.patch new file mode 100644 index 0000000000..574d10c1b8 --- /dev/null +++ b/package/uclibc-ng-test/0001-add-nios2-tls-macros-from-glibc.patch @@ -0,0 +1,84 @@ +From bf6fcd59d1ff51584a703b1d78c9e8fd4f808917 Mon Sep 17 00:00:00 2001 +From: Fabrice Fontaine +Date: Sat, 28 Nov 2020 11:44:00 +0100 +Subject: [PATCH] add nios2 tls macros from glibc + +Retrieved from +https://github.com/bminor/glibc/blob/master/sysdeps/nios2/tls-macros.h + +Signed-off-by: Fabrice Fontaine +[Retrieved from: +https://github.com/wbx-github/uclibc-ng-test/commit/bf6fcd59d1ff51584a703b1d78c9e8fd4f808917] +--- + test/tls/tls-macros-nios2.h | 46 +++++++++++++++++++++++++++++++++++++ + test/tls/tls-macros.h | 4 ++++ + 2 files changed, 50 insertions(+) + create mode 100644 test/tls/tls-macros-nios2.h + +diff --git a/test/tls/tls-macros-nios2.h b/test/tls/tls-macros-nios2.h +new file mode 100644 +index 0000000..7029530 +--- /dev/null ++++ b/test/tls/tls-macros-nios2.h +@@ -0,0 +1,46 @@ ++#define TLS_LE(x) \ ++ ({ int *__result; \ ++ asm ("addi %0, r23, %%tls_le(" #x ")" \ ++ : "=r" (__result)); \ ++ __result; }) ++ ++#define TLS_IE(x) \ ++ ({ int *__result; \ ++ int __tmp; \ ++ asm ("nextpc %0 ; " \ ++ "1: movhi %1, %%hiadj(_gp_got - 1b) ; " \ ++ "addi %1, %1, %%lo(_gp_got - 1b) ; " \ ++ "add %0, %0, %1 ; " \ ++ "ldw %1, %%tls_ie(" #x ")(%0) ; " \ ++ "add %1, r23, %1" \ ++ : "=&r" (__tmp), "=&r" (__result)); \ ++ __result; }) ++ ++#define TLS_LD(x) \ ++ ({ char *__result; \ ++ char *__result2; \ ++ int *__result3; \ ++ int __tmp; \ ++ extern void *__tls_get_addr (void *); \ ++ asm ("nextpc %0 ; " \ ++ "1: movhi %1, %%hiadj(_gp_got - 1b) ; " \ ++ "addi %1, %1, %%lo(_gp_got - 1b) ; " \ ++ "add %0, %0, %1 ; " \ ++ "addi %0, %0, %%tls_ldm(" #x ")" \ ++ : "=r" (__result), "=r" (__tmp)); \ ++ __result2 = (char *)__tls_get_addr (__result); \ ++ asm ("addi %0, %1, %%tls_ldo(" #x ")" \ ++ : "=r" (__result3) : "r" (__result2)); \ ++ __result3; }) ++ ++#define TLS_GD(x) \ ++ ({ int *__result; \ ++ int __tmp; \ ++ extern void *__tls_get_addr (void *); \ ++ asm ("nextpc %0 ; " \ ++ "1: movhi %1, %%hiadj(_gp_got - 1b) ; " \ ++ "addi %1, %1, %%lo(_gp_got - 1b) ; " \ ++ "add %0, %0, %1 ; " \ ++ "addi %0, %0, %%tls_gd(" #x ")" \ ++ : "=r" (__result), "=r" (__tmp)); \ ++ (int *)__tls_get_addr (__result); }) +diff --git a/test/tls/tls-macros.h b/test/tls/tls-macros.h +index 4a4e916..087b365 100644 +--- a/test/tls/tls-macros.h ++++ b/test/tls/tls-macros.h +@@ -64,6 +64,10 @@ + #include + #endif + ++#ifdef __nios2__ ++#include ++#endif ++ + #if defined(__powerpc__) && !defined(__powerpc64__) + #include + #endif