From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com [IPv6:2a00:1450:4864:20::536]) by sourceware.org (Postfix) with ESMTPS id 1985E3858C50 for ; Tue, 12 Sep 2023 16:42:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1985E3858C50 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-ed1-x536.google.com with SMTP id 4fb4d7f45d1cf-52bcd4db4e6so7627636a12.0 for ; Tue, 12 Sep 2023 09:42:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1694536940; x=1695141740; darn=sourceware.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=ExIaTPo2WNT8moi7vuBDeKXKCwk/RADjALmpD77rXds=; b=i79E6pJEbC96B/faz0pAQ9YDyfVODnv2EfkEsJjr1xFETu0VsrxV6tJgvzgrgyPxhI FOrihSwZUusoRK8Mz/lhwWi9DA5WxyCQfVQalf8g/IVa2pmuwFlHs3M/LG3m/1A4kmZI 0l6wFNRM0ne0ZQK7ruYZGtWLL2pstyRnet0PDYKFtOFZkapE4vwu3qPGz4SnGfwQBKgL /Ry1748aZG66sf/R4oSUavMGKRhY5Gn47gupGOobk4UQYlmLE+oteoGxxRnLfKgth+Bs JZszVeSR5uoZ/vyxgUtaKlohEj5JF4Slw5RAlHfwdikgPTjCIkKBGsDekvoVInasLVZs F5lg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694536940; x=1695141740; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=ExIaTPo2WNT8moi7vuBDeKXKCwk/RADjALmpD77rXds=; b=XaIZ58GnEPfzQ0/+uSTmv6Y+n3ixcps9yGNcGj0xVOAYoNYJiUK0PB0xnKDLrL31dL 6X9MKHefqCgZxsdVZPvnJWDLhZvJ+lh4zElBhCT/ztqpnrmtALFswKsSrp65uOHb9QDM 7y3bt0frqnZCSusiG4J8PmEKd/Bn6FSrvd4obY0j4z4rNH2VADad0TUkYMnYcZ9My2Ui bRsRDNpY/BE+9AkbpquW3h0vPK9yvXwwoeKiXTq3Oswfgu4W3Z2uY+H9evfwgMc+H4AJ f+mkg1zpDgKcjYGgtrPUm2KHYkdztsQkfTHYg9gQHMAcohqS18WPbL22mF96B15jZD+N puQg== X-Gm-Message-State: AOJu0YwzVf+xL/afxIIwwGBQMOagiGyQcJQ/lovz+2UVGXs8vRJNNlor jclvgAx/Nn1vbRXCLbyTKR7wEvE9Wc5XB11aBwNj+e72uM0= X-Google-Smtp-Source: AGHT+IGXN+yv4HxwnL+AQpkQeUNtiz7ahDvWCy+oILS6Toni5YCBobaEXrFalreJFtm6D1VvAEOAPwdqMxf003byYyY= X-Received: by 2002:aa7:d0c5:0:b0:523:3f45:5678 with SMTP id u5-20020aa7d0c5000000b005233f455678mr152702edo.31.1694536940401; Tue, 12 Sep 2023 09:42:20 -0700 (PDT) MIME-Version: 1.0 From: Vincent Fortier Date: Tue, 12 Sep 2023 12:42:09 -0400 Message-ID: Subject: Bug when cross-compiling for ppc To: gdb@sourceware.org Content-Type: text/plain; charset="UTF-8" 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: As introduction, I part of SynoCommunity who maintains free software packages that can be installed on synology NAS. Multiple archs are supported from armv5, v7, v8, ppc, i686 and x64. I am able to build gdb for all archs with exception of ppc, more specifically qoriq arch using gcc-4.9.3 from Synology provided toolchain. github PR available here: https://github.com/SynoCommunity/spksrc/pull/5879 I was finally able to figure out why (now needs to know how to fix it) gdb fails to cross-compile for ppc. I am able to reproduce this problem on both gdb-7.12.1 and latest 13.2. Basically, when it goes into the configure script under sim/ppc at a certain point it tests the "build" c compiler: checking for i686-pc-linux-gcc... gcc checking whether the C compiler works... no configure: error: in `/home/spksrc/qoriq-debug/spksrc/cross/gdb-latest/work-qoriq-6.2.4/gdb-13.2/sim/ppc/build.4119280': configure: error: C compiler cannot create executables See `config.log' for more details mv: cannot stat 'config.h': No such file or directory The end-result way later on is that build-config.h is then missing: fatal error: build-config.h: No such file or directory 23 | #include "build-config.h" | ^~~~~~~~~~~~~~~~ compilation terminated. As at the end of sim/ppc/configure it does a mv config.h ../build-config.h but config.h was not generated in the first place. What I ended-up doing is commenting out the tmpdir removal from that configure script: CFLAGS="${saved_CFLAGS}" mv config.h ../build-config.h cd .. ###rm -rf $tempdir Which allowed me to keep track of the real error happening in background: configure:2482: checking whether the C compiler works configure:2504: gcc -g -O -I/home/spksrc/qoriq-debug/spksrc/toolchain/syno-qoriq-6.2.4/work/powerpc-e500v2-linux-gnuspe/powerpc-e500v2-linux-gnuspe/sysroot/usr/include -mcpu=8548 -mhard-float -mfloat-gprs=double -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=' is deprecated; use '-mtune=' or '-march=' instead gcc: error: unrecognized command-line option '-mfloat-gprs=double' configure:2508: $? = 1 configure:2546: result: no When testing the "build" compiler it includes the "target" flags which includes -mcpu=8548 -mhard-float -mfloat-gprs=double. In turns these flags should never get used on with "build" compiler making it to fail. Now the question is, how to fix that? Help would be much welcomed :)