From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-il1-x141.google.com (mail-il1-x141.google.com [IPv6:2607:f8b0:4864:20::141]) by sourceware.org (Postfix) with ESMTPS id 56C713842430; Tue, 28 Jul 2020 15:05:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 56C713842430 Received: by mail-il1-x141.google.com with SMTP id g6so1514559ilc.7; Tue, 28 Jul 2020 08:05:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=IrO4/zWIj3UzMBUO7qHuiV6+H9F+i5Mv3Y6AoJvH97g=; b=OgP5gIXYiylZrsrP4fDfT41QT7GT+ZktuQxYFQV9NKIRu0xL+Dq+2tNp4/O4rsY3jZ yP08LqmVsOTfK1kMZr7ObT5ixvvlqSRTw1f1C3hvtlwbdvQRQtqNEn7bC22dxHweiFR1 rtOl8INlIjN2cvX70QtvXNfrFuIvqzCp49V2L/eE2eEDSmQ2RiuOhwcJj76ABESuSAV/ o00+6kWSvN8dy7BGvswmLmJgH08xwvZwfgClzEACTlhd/YBkQpBPYSdZnDzYJONkvkff IBzzkdsxVVBVvKXJPXvh0eS4W/gWp+UDP3O3Es/6aTbpU9BMOYkAL+kljs9ueRFApoLN 5X0w== X-Gm-Message-State: AOAM5306D4Q6zq4Bq+vT5BqRh03CFD5ab+Mvxt/fuL0Pny60xAoe6Rdo ogfk/RI+VdVizwU7YAetmTXB+MeSLXy90syEh1fx2fIcOjg= X-Google-Smtp-Source: ABdhPJxJi5xRGw3/SOu+ne2jB7HvR5Ikk1LKTDdWiYLPtZlUKirUCg819870ziuIPO5IDmZ0F0CLjsbUhwrbE6RxHW8= X-Received: by 2002:a92:874a:: with SMTP id d10mr29749409ilm.273.1595948752693; Tue, 28 Jul 2020 08:05:52 -0700 (PDT) MIME-Version: 1.0 References: <20200502022903.175852-1-amerey@redhat.com> <87eep4hp3s.fsf@tromey.com> <996bd0f9-cec5-119c-19ea-b127cf1bb95d@simark.ca> <87r1svyche.fsf@igel.home> In-Reply-To: From: "H.J. Lu" Date: Tue, 28 Jul 2020 08:05:16 -0700 Message-ID: Subject: Re: V2 [PATCH] PKG_CHECK_MODULES: Check if $pkg_cv_[]$1[]_LIBS works To: Simon Marchi Cc: Andreas Schwab , "H.J. Lu via Binutils" , Tom Tromey , GCC Patches , GDB , Aaron Merey Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-3.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jul 2020 15:05:54 -0000 On Tue, Jul 28, 2020 at 7:34 AM Simon Marchi wrote: > > On 2020-07-28 10:11 a.m., H.J. Lu wrote: > > On Tue, Jul 28, 2020 at 7:01 AM Simon Marchi wrote: > >> > >> On 2020-07-28 9:56 a.m., H.J. Lu wrote: > >>> On Tue, Jul 28, 2020 at 6:51 AM Andreas Schwab wrote: > >>>> > >>>> On Jul 28 2020, H.J. Lu via Binutils wrote: > >>>> > >>>>> On x86, the native GCC can support -m32 and -m64. "gcc -m32" or "gcc -m64" > >>>>> are not cross compiling. > >>>> > >>>> You cannot link -m64 and -m32 together. > >>>> > >>>>> I didn't set PKG_CONFIG_LIBDIR and I don't want to set it. > >>>> > >>>> Then use the correct pkg-config for your target. If you think > >>>> pkg-config is broken, then fix _that_. > >>>> > >>> > >>> I did: > >>> > >>> RUNTESTFLAGS="--target_board 'unix{-m32}'" CC="gcc -m32 -fno-lto > >>> -fcf-protection" > >>> CXX="g++ -fno-lto -m32 -fcf-protection" /exp > >>> ort/gnu/import/git/gitlab/x86-binutils/configure \ > >>> --enable-targets=x86_64-linux \ > >>> i686-linux \ > >>> --enable-plugins --disable-gdb --disable-gdbserver --disable-libdecnumbe > >>> r --disable-readline --disable-sim --with-sysroot=/ --with-system-zlib \ > >>> --prefix=/usr/local \ > >>> --with-local-prefix=/usr/local > >>> configure: WARNING: you should use --build, --host, --target > >>> checking build system type... i686-pc-linux-gnu > >>> checking host system type... i686-pc-linux-gnu > >>> checking target system type... i686-pc-linux-gnu > >> > >> So... is your build system a 32-bit one? Why does the above say i686-pc-linux-gnu > >> and not x86_64-something? > >> > > > > My system supports both -m32 and -m64. Depending on CC, configure > > selects i686 or x86-64 target. > > Can you clarify how this magic works, is this standard autoconf? Because I am trying this > on Fedora, so pretty much the same setup as you, and I don't see this behavior: > > $ /home/simark/src/binutils-gdb/configure CC="gcc -m32" CXX="g++ -m32" > checking build system type... x86_64-pc-linux-gnu > checking host system type... x86_64-pc-linux-gnu > checking target system type... x86_64-pc-linux-gnu > ... > I checked it again. I also passed i686-linux, not --host=, to configure. > > And even if it worked, why would it set "build" to i686, it doesn't make sense. The gcc you > compile with, and its environment, is still x86_64, not i686. > > So *if* it works, it would be a shortcut for setting --host=i686-something, maybe. So > regardless of how that above works, that doesn't remove the need to configure pkg-config > correctly for the host system. > > If you don't want to learn about with pkg-config and deal with it, then please say "I think > we should not use pkg-config", and ideally give supporting points. Please don't unilaterally > push patches just to paper over your own problems. You just make it so that somebody will > need to untangle more mess later. I am OK to remove pkg.m4. -- H.J.