From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id GQPiMQyVAGXpAhUAWB0awg (envelope-from ) for ; Tue, 12 Sep 2023 12:42:52 -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=cYHF6JEZ; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id C1C221E0C3; Tue, 12 Sep 2023 12:42:52 -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 B4A0D1E092 for ; Tue, 12 Sep 2023 12:42:50 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 28EC63858430 for ; Tue, 12 Sep 2023 16:42:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 28EC63858430 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1694536970; bh=ExIaTPo2WNT8moi7vuBDeKXKCwk/RADjALmpD77rXds=; h=Date:Subject:To:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=cYHF6JEZtVZ9UAaQLNQt4mW6LIKf3QiL2H8FwfTEV1SjqEVXkoS3q06JTrzbNdizy LixgT2+ZvrxgML5jOD3ddaKLXBX4OQV8L08tgRZUmvpkNFefWjElN5nQpTa8bR3Xa7 Nqv2M+zA0RhOPlbvnfgj5TPTKlHf9ABIr4k8C5Kk= 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 Received: by mail-ed1-x536.google.com with SMTP id 4fb4d7f45d1cf-52bcd4db4e6so7627636a12.0 for ; Tue, 12 Sep 2023 09:42:22 -0700 (PDT) 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 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 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" 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 :)