From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-f173.google.com (mail-lj1-f173.google.com [209.85.208.173]) by sourceware.org (Postfix) with ESMTPS id EEC7F3858407 for ; Wed, 15 Jun 2022 23:06:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org EEC7F3858407 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=groose.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-lj1-f173.google.com with SMTP id s10so14874790ljh.12 for ; Wed, 15 Jun 2022 16:06:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=/ctPf3hlzlYtfres+ldpERzcypaaEhyOGFMwzj22We0=; b=faqtYs59htsyueG1OqlgvWk+yJ55Lll1f7/QR43PjuHripNX633XdxMGo1jluhtp5I e4SVPuzY9N7HVCuiz2oghOjwu4slXyrcuUHydV5szvwi74Qodi4p+aXmHRzcvsyIkKqg lpfGcAkH4f4GbY0wUCI6QMrAJnioMDXsNpL8JWYinTWsAZSxXS5XCh82k2aepfyg3A5D q2988Ihn53BOla/jB4cTSomNSV/XEFHweLcIdqiabXGwd/To384UfVH1jWxxukgXOaGy fiGd6UTno9nkeCuvCf8sEZhuTLvRLZ3Tpg8Y8FnKF2DzJQLPHPWbiXt1eaepV3gVMKhK mi9g== X-Gm-Message-State: AJIora9ExtRlOMi5i0zgeSnKas6B3xAZ1doXQI91ysrpSkpqCcOJBfv1 LwJrqi9SBxoNgfgltgeGgNUJhUIP8IEkLwlqMgU= X-Google-Smtp-Source: AGRyM1sbOEm3IPC6utxzf13GABCK+NtzC/DP45GbPA40+ZgvH5bLUrooUuC2aWYI1rj83qe/pB1WxB8NeBGRN4wm+7k= X-Received: by 2002:a2e:954e:0:b0:255:3768:9986 with SMTP id t14-20020a2e954e000000b0025537689986mr1111644ljh.516.1655334384417; Wed, 15 Jun 2022 16:06:24 -0700 (PDT) MIME-Version: 1.0 References: <8109E6B6-F99A-473B-9E8B-A540FC7679CD@splunk.com> In-Reply-To: From: Brian Groose Date: Wed, 15 Jun 2022 19:06:12 -0400 Message-ID: Subject: Re: Building Linux x86_64 to AIX PowerPC cross-compiler To: Kai Ruottu Cc: Paul Lucas , gcc-help Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, KAM_SHORT, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-help@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-help mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Jun 2022 23:06:27 -0000 On Wed, Jun 15, 2022 at 7:37 AM Kai Ruottu wrote: > > Paul Lucas via Gcc-help kirjoitti 14.6.2022 klo 19.18: > > Hi there - > > > > I want to build a cross-compiler from Linux x86_64 (host) to AIX PowerPC (target). Eventually, while building gcc, I get: > > > >> collect2: fatal error: libgcc.a: cannot open as COFF file > > > > While Linux uses ELF and AIX uses coff, I would have assumed that the binutils I built for the cross-compiler would have produced a linker that was able to link COFF files. > > > > The configure for binutils was: > > > >> configure --disable-gold --prefix=/aix-powerpc --disable-multilib --disable-nls --target=powerpc-ibm-aix7.1.0.0 --with-sysroot=/aix-powerpc --with-arch=powerpc --disable-werror --enable-plugins > > where /aix-powerpc contains headers and libraries copied from a live AIX system. > > > The GNU Install documents for target platforms : > > https://gcc.gnu.org/install/specific.html#x-ibm-aix > > are saying : > > "The native |as| and |ld| are recommended for bootstrapping on AIX. The > GNU Assembler, GNU Linker, and GNU Binutils version 2.20 is the minimum > level that supports bootstrap on AIX 5. The GNU Assembler has not been > updated to support AIX 6 or AIX 7. The native AIX tools do interoperate > with GCC." > > So it seems that AIX 6 and AIX 7 aren't supported in GNU binutils :( > > The biggest problem in this issue probaly is that so few people can get > the "headers and libraries copied from a live AIX system". Or IBM or > something would provide them freely > for everyone wanting to make crosscompilers for AIX. Those who have AIX > systems just produce native GNU tools and are happy. Others aren't > interested to work with cross > tools they cannot make... > For instance the Sun Solaris2 headers and libraries have beem freely > available just like the whole Sparc/x86 operating systems. So anyone > could have procuded crosstools for these > platforms if having the required know-how for building GNU tools. I had also tried to get a Linux x86_64 cross compiler targeting AIX 6.1 several years ago and was never able to make it work, the issue was always binutils and not gcc. Even when I compiled native binutils and gcc on AIX 6.1 I ended up using the AIX versions of as/ld/ar/etc since they worked more reliably than the binutils versions. I eventually gave up on a cross compiler and continued to natively compile, though cross compilation would have been a much nicer and more scalable system. I recall bumping into the docs that Kai quoted here, which confirmed that it just wasn't going to work since there was effectively no assembler that worked.