From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id /23CC4JuA2XVMRYAWB0awg (envelope-from ) for ; Thu, 14 Sep 2023 16:35:14 -0400 Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=gCFcmHBk; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 26F281E0C3; Thu, 14 Sep 2023 16:35:14 -0400 (EDT) Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 1A50F1E092 for ; Thu, 14 Sep 2023 16:35:12 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 97ADD3857347 for ; Thu, 14 Sep 2023 20:35:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 97ADD3857347 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1694723711; bh=XtkojjOGRgtCSGgWEl3JAgHWHNQMgUd/co+XdozEJpE=; h=References:In-Reply-To:Date:Subject:To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=gCFcmHBkeMmZOtWpHV/9YZ6l2NEGP836HTAkvWQAy7tAg2Qp9+psK3FU32OoxpKHE DyA8/fezhZVrTuRKCBTdJaR2F324pVPAksHq3RQnffBxGWkrKy16iryJsOfrNQIjzR hmJwBzeg0A0+ph9nn6sZG7nzmMhLQZZaKaSEQ92I= Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by sourceware.org (Postfix) with ESMTPS id C949C3858C52 for ; Thu, 14 Sep 2023 20:34:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C949C3858C52 Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-31f7400cb74so1197072f8f.2 for ; Thu, 14 Sep 2023 13:34:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694723683; x=1695328483; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XtkojjOGRgtCSGgWEl3JAgHWHNQMgUd/co+XdozEJpE=; b=NTpekkdB9s6kYxXLM+w4szBQMuegq28yr6KxofgHsFH/j+KYkOQXAHyurhMTQoMAff dSeRHNX1I7gC/yg5yArQXB/BrzKT4CLRC+uHEi9tyDvXDa23EGtCfovYm/kNhJ1KaPQt WYX7yIxq5z0p0JPpTybiCQ8tdQa1Y72Ye6t5FAVuXnhdH69nWzu1nQcLRjImRl2bVfDF +UX7pY4STFu8g87k2x7SniOHvXB/3zoJNpuB1A7f269bP6Yijsuqzfx2grXEACx4pUH/ 4tWJ9tSlvBZ0bF/IVr4R9sWLK4tfTSlO5Xr7GP9dmU7BiMISr22gy1XhxZQ9ExR72k2C DQhQ== X-Gm-Message-State: AOJu0Yz4UrY/c1uVOAe8z8daXAUQ+NzoeNZtXL8WweHBeU1zfrDsW6T1 lSf2CfjVCz5uL67we7K/csLIZ/CazY4gJ+hT7BGJp8qLZOU= X-Google-Smtp-Source: AGHT+IE7FjT8aULpSRqlDRj3hcMqBGY/XbFd+qohqPmjJjBWEmxvzu8O7rY9oxKY9zcZCRQrqSnaCb+LrLtvhcnG22A= X-Received: by 2002:adf:f4c4:0:b0:319:52da:8f0b with SMTP id h4-20020adff4c4000000b0031952da8f0bmr6156928wrp.17.1694723683253; Thu, 14 Sep 2023 13:34:43 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Thu, 14 Sep 2023 16:34:32 -0400 Message-ID: Subject: Re: Bug when cross-compiling for ppc To: Andreas Schwab Cc: Vincent Fortier via Gdb Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Vincent Fortier via Gdb Reply-To: Vincent Fortier Errors-To: gdb-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb" Le jeu. 14 sept. 2023, =C3=A0 02 h 24, Andreas Schwab a = =C3=A9crit : > > On Sep 12 2023, Vincent Fortier via Gdb wrote: > > > Now the question is, how to fix that? Help would be much welcomed :) > > You need to set CFLAGS_FOR_BUILD (to something non-empty), so it does > not default to $CFLAGS (which is questionable in the first place). > > -- > Andreas Schwab, SUSE Labs, schwab@suse.de > GPG Key fingerprint =3D 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D= 7 > "And now for something completely different." For a start, I ended-up disabling sim entirely for PPC and now it's building just fine. I had found a ticket from openwrt having a somewhat similar issue that was disabling it as well. So I used that option too. I've tried that by setting CFLAGS_FOR_BUILD=3D'-O2' just for the sake of it not being empty but I'm still getting errors: compilation terminated. make[7]: *** [Makefile:660: table.o] Error 1 In file included from ./gen-icache.c:22: ./misc.h:23:10: fatal error: build-config.h: No such file or directory 23 | #include "build-config.h" | ^~~~~~~~~~~~~~~~ Further looking into the logs there's this hidden in a temporary directory (once rm of it is commented out) configure:2482: checking whether the C compiler works configure:2504: gcc -O2 -I/home/spksrc/qoriq-debug/spksrc/toolchain/syno-qoriq-6.2.4/work/powerpc-e= 500v2-linux-gnuspe/powerpc-e500v2-linux-gnuspe/sysroot/usr/include -mcpu=3D8548 -mhard-float -mfloat-gprs=3Ddouble -I/home/spksrc/qoriq-debug/spksrc/cross/gdb-latest/work-qoriq-6.2.4/install= /usr/local/gdb/include conftest.c >&5 gcc: warning: '-mcpu=3D' is deprecated; use '-mtune=3D' or '-march=3D' inst= ead gcc: error: unrecognized command-line option '-mfloat-gprs=3Ddouble' configure:2508: $? =3D 1 configure:2546: result: no The exec string from sim/ppc is $ .././configure --enable-languages=3Dall --target=3Dpowerpc-e500v2-linux-gnuspe --host=3Di686-pc-linux --build=3Di686-pc-linux But as you can see I believe it refers to the "build" C compiler instead of the"target" compiler OR uses the "target" flags instead of the "build" flags (wonder why it would?). Anyhow, disabling sim/ppc fixed things for now. Migrating gdb to cmake using toolchain files or meson would potentially remove these issues and simplify cross-compiling while reducing build time. But that's unrelated...