From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: libstdc++ for cross compilers Date: Wed, 12 Apr 2017 11:24:59 +0200 Message-ID: <87zifmdllg.fsf@gnu.org> References: <87o9w41jkl.fsf@elephly.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:45010) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cyEWS-0005U6-HW for help-guix@gnu.org; Wed, 12 Apr 2017 05:25:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cyEWO-00051j-9K for help-guix@gnu.org; Wed, 12 Apr 2017 05:25:08 -0400 In-Reply-To: <87o9w41jkl.fsf@elephly.net> (Ricardo Wurmus's message of "Mon, 10 Apr 2017 15:24:58 +0200") List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+gcggh-help-guix=m.gmane.org@gnu.org Sender: "Help-Guix" To: Ricardo Wurmus Cc: help-guix Hello! Ricardo Wurmus skribis: > The latest version includes C++ sources for the firmware. > Unfortunately, our =E2=80=9Carm-none-eabi=E2=80=9D cross-compiler package= does not > build libstdc++, nor does it come with any of the required C++ headers > like =E2=80=9Ccmath=E2=80=9D. > > So I tried to change our =E2=80=9Carm-none-eabi=E2=80=9D cross-compiler p= ackages to also > build and install libstdc++ but failed in a multitude of ways. The end > result is always that either the compiler fails to build (e.g. when > enabling libstdc++ via configure flags) or that the compiler fails to > find the header files that are included via =E2=80=9C#include_next=E2=80= =9D directives > (e.g. when building libstdc++ as a separate package). > > Could someone with GCC experience give me a hint despite my vague > problem description? libstdc++ itself can probably be cross-built with: guix build libstdc++ --target=3Darm-none-eabi The problem is getting a cross-g++. I suspect libstdc++ sorta relies on having a =E2=80=9Creal=E2=80=9D libc, which is why we normally do things li= ke: (let ((triplet "arm-linux-gnueabihf")) (cross-gcc triplet (cross-binutils triplet) (cross-libc triplet)))) where the final =E2=80=98cross-gcc=E2=80=99 has C++ support. I=E2=80=99m not sure if it makes sense for the board you=E2=80=99re targeti= ng, but maybe you could try building with a full-blown cross-gcc like this? HTH, Ludo=E2=80=99.