From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-x429.google.com (mail-pf1-x429.google.com [IPv6:2607:f8b0:4864:20::429]) by sourceware.org (Postfix) with ESMTPS id 718C33858C2D for ; Fri, 13 May 2022 00:05:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 718C33858C2D Received: by mail-pf1-x429.google.com with SMTP id v11so6220253pff.6 for ; Thu, 12 May 2022 17:05:47 -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:content-transfer-encoding; bh=rl+OQoWudUiyHDiMuRVRqomqQMApSpExt+0o427fhGI=; b=J++h/AcYltqlidtLt/jS96eb23mQFbLmn7Wh7qy8m0BoHcDIV+omySger0oDx5tmkS U6yaP4/FKlUnb2Zbwuw8G3as1eYkY8FxFHUq+65wz/2WaT2EkGiaJUR4lBhhPXy9HbpA JgpVD6O430hlbUOCRmz6V/3NsL3WG2ToD9XUTaPiPx0UlDrNv07h89pyj/2eIVDrUh/7 q2IJ18BGlTG28x3QM8BUXWwfWbRegn/YOD2Ug2UCY80dgAF0Ec0KMPwWFTk+5ckMXi55 6N/JW1sqrZxK9xf6u5nz5H2AdyeU3M5IieBMf8ULtevkKEuh46d8qFOBLQImKSsxdUDe /FCA== X-Gm-Message-State: AOAM530Ro6AQprI+2WNvqBYwEnD+oIWfz4+n1fNXmtrkarZhEkx7GOHc lDxtdJuLcQzP8o2+DLEoMXTSub3grwuSqSva0063hKLS X-Google-Smtp-Source: ABdhPJx0SNTE1BtwFfQVidgSTg8tkHcnhCKN2ma4tr02AYC1cLMnneMlgEHz9yUUxnbuX5q8dWHuiUhcpIXXhLreFAQ= X-Received: by 2002:a63:874a:0:b0:3c6:aa29:15f6 with SMTP id i71-20020a63874a000000b003c6aa2915f6mr1663612pge.210.1652400346461; Thu, 12 May 2022 17:05:46 -0700 (PDT) MIME-Version: 1.0 References: <30135F64-25DC-411B-A800-6D870BB2AAD9@splunk.com> <08A4459C-97E2-4626-9E3A-44A340722DE2@splunk.com> In-Reply-To: <08A4459C-97E2-4626-9E3A-44A340722DE2@splunk.com> From: "H.J. Lu" Date: Thu, 12 May 2022 17:05:10 -0700 Message-ID: Subject: Re: Cross-compile on Linux for Solaris x86 To: Paul Lucas Cc: Binutils Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-3019.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, KAM_NUMSUBJECT, RCVD_IN_DNSWL_NONE, 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: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 May 2022 00:05:49 -0000 On Thu, May 12, 2022 at 4:33 PM Paul Lucas wrote: > > > > > On May 12, 2022, at 1:37 PM, H.J. Lu wrote: > > > > On Thu, May 12, 2022 at 12:14 PM Paul Lucas via Binutils > > wrote: > >> > >> Hello - > >> > >> I=E2=80=99m building a cross-compiled gcc and binutils on Linux x86_64= for Solaris x86_64. The problem is that the executables produced hard-code= the wrong path for the dynamic linker and get killed immediately upon laun= ch. In elfxx-x86.c, the path for ELF64_DYNAMIC_INTERPRETER is defined as "/= lib/ld64.so.1", but should be "/lib/amd64/ld.so.1" on a Solaris x86_64 syst= em. > >> > >> I came across this exact problem here: > >> > >> https://binutils.sourceware.narkive.com/hNh1UFx2/building-a-cross-for-= solaris-x86-target#post2 > >> > >> That thread is 15 years (!) old and implies this issue has beed addres= sed in the binutils 2.17/2.18 timeframe. I=E2=80=99m building binutils 2.32= and still hitting this same problem. > >> > >> What=E2=80=99s the fix? > > > > 1. Please get binutils 2.38. > > OK, I did. Same result. > > > 2. Configure binutils 2.38 to target Solaris/x86-64. > > Specifically, I did: > > configure --enable-gold=3Ddefault --disable-ld --enable-lto --prefix=3D/s= olaris-x86_64 --disable-multilib --disable-nls --target=3Dx86_64-sunos-sola= ris2.11 --with-sysroot=3D/solaris-x86_64 --disable-werror --enable-plugins Gold doesn't support Solaris. > which is what I=E2=80=99ve been doing. > > Assuming that you didn=E2=80=99t make a typo when you typed "x86-64=E2=80= =9D (with a dash, not an underscore), I also tried: > > --target=3Dx86-64-sunos-solaris2.11 > > but then the target triple parser presumably gets confused and complains: > > Kernel `sunos' not known to work with OS `solaris2.11=E2=80=99 > > Looking at the binutils source code, the literal string "/lib/ld64.so.1= =E2=80=9D still occurs and the literal string "/lib/amd64/ld.so.1=E2=80=9D = still doesn=E2=80=99t. > > - Paul > --=20 H.J.