From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-31f7400cb74so1197072f8f.2 for ; Thu, 14 Sep 2023 13:34:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1694723683; x=1695328483; darn=sourceware.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=XtkojjOGRgtCSGgWEl3JAgHWHNQMgUd/co+XdozEJpE=; b=r8U+EKeJbP1147MUZYpvY9T+pTfvYfn2M7odXzzTJelPCDe1qh67opJFklZP2PyTS7 NI2r2lU3Znr0ZV4KRHLYUH8wszApjap4uR/9wT05oe9HF2/Tvq1AF5SBSKaTuU1n7TvN wCj9HFPnreffsOP5vjWph0RsfzEVGnqA+GpQn+AQDK/CFrSyO2rnNyJlD7M/RMcAwY0f fobQm3Y1yLsGZ4uPDeW7ps9KxtRfmvrKmZZdb5zlqWKpbuLOj1psrb00CqTLSNDtreJ6 /HuqfXlUQHk6AJoHh5qeNnVnwFBFRQq0zWtQs/H7Nt+GCfcR5QDVbXIB2IlBgirehvVQ J3dQ== 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: From: Vincent Fortier 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 List-Id: 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...