Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Simon Marchi <simark@simark.ca>
To: "H.J. Lu" <hjl.tools@gmail.com>
Cc: Aaron Merey <amerey@redhat.com>, Tom Tromey <tom@tromey.com>,
	GCC Patches <gcc-patches@gcc.gnu.org>,
	Aaron Merey via Binutils <binutils@sourceware.org>,
	GDB <gdb-patches@sourceware.org>
Subject: Re: V2 [PATCH] PKG_CHECK_MODULES: Check if $pkg_cv_[]$1[]_LIBS works
Date: Tue, 28 Jul 2020 09:54:32 -0400	[thread overview]
Message-ID: <3627b719-b2c5-5605-bae8-f444b57f9cb1@simark.ca> (raw)
In-Reply-To: <CAMe9rOpYYvXnu1NNfPEhfFay=m8Q7M7VvPSjwphkqy5JUR3pwg@mail.gmail.com>

On 2020-07-28 9:33 a.m., H.J. Lu wrote:
> On x86, the native GCC can support -m32 and -m64.  "gcc -m32" or "gcc -m64"
>  are not cross compiling.

And how does that make it not cross-compîling?

>> Anyway regardless of vocabulary, I don't think there was a problem to begin with (not that I blame
>> you, it's not made in an intuitive way).  The problem is that you were using pkg-config as
>> configured to look up x86_64 packages.  It looks up .pc files in (amongst others)
>> /usr/lib64/pkgconfig, which provides information about x86_64 packages, which are in turn obviously
>> not suitable not suitable to build a i686 program.  Just like you cross-compile "for real" (say,
>> for an ARM host), you need to set PKG_CONFIG or the PKG_CONFIG_* variables to returns packages for
>> the --host architecture.  That means searching in /usr/lib/pkgconfig instead of /usr/lib64/pkgconfig.
>>
>> You could for example set the PKG_CONFIG_LIBDIR variable to /usr/lib/pkgconfig:/usr/share/pkgconfig
> 
> I didn't set PKG_CONFIG_LIBDIR and I don't want to set it.

Why are you fine adjusting CC="gcc -m32" but not PKG_CONFIG*?

> 
>> This way, if you don't install the elfutils-debuginfod-client-devel.i686 package, your binutils won't
>> try to link with libdebuginfod (because pkg-config won't find it).  If you install it, then your
>> binutils will be built against the i686 libdebuginfod.
>>
>> Ideally, distros would ship a i686-something-something-pkg-config that automatically searchs in paths
>> that make sense for that architecture (just like you have arm-linux-gnueabihf-pkg-config when cross
>> compiling for ARM), but that doesn't seem to exist.  But this is just like you have to explicitly set
>> CC="gcc -m32" instead of using some i686-something-something-gcc.
>>
>> You can always make it yourself, create, say, a `i686-pc-linux-gnu-pkg-config` file somewhere in $PATH,
>> with:
>>
>>   export PKG_CONFIG_LIBDIR=/usr/lib/pkgconfig:/usr/share/pkgconfig
>>   exec pkg-config $*
> 
> I don't want to do it.  PKG_CHECK_MODULES should check if the library
> really works.
> Otherwise we can use remove it and use the library directly without checking.

We could, but that would have its own disadvantages.

Simon


  parent reply	other threads:[~2020-07-28 13:54 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20200502022903.175852-1-amerey@redhat.com>
     [not found] ` <3d9da16939fa6b503188033b56d30531e03d5d2a.camel@redhat.com>
2020-05-05 21:23   ` [PATCH] config/debuginfod.m4: Use PKG_CHECK_MODULES Aaron Merey
2020-05-08 20:56     ` Tom Tromey
2020-07-16 22:17       ` Aaron Merey
2020-07-16 22:37       ` Aaron Merey
2020-07-19 15:43         ` Simon Marchi
2020-07-21 15:20           ` Tom Tromey
2020-07-21 18:11             ` Aaron Merey
2020-07-24 20:03               ` Aaron Merey
2020-07-25 16:01                 ` H.J. Lu
2020-07-27 15:31                   ` [PATCH] config/debuginfod.m4: Restore AC_CHECK_LIB check H.J. Lu
2020-07-27 16:11                     ` Aaron Merey
2020-07-27 19:14                       ` [PATCH] PKG_CHECK_MODULES: Check if $pkg_cv_[]$1[]_LIBS works H.J. Lu
2020-07-27 19:32                         ` V2 " H.J. Lu
2020-07-28 10:45                           ` H.J. Lu
2020-07-28 12:46                             ` Simon Marchi
2020-07-28 13:33                               ` H.J. Lu
2020-07-28 13:51                                 ` Andreas Schwab
2020-07-28 13:56                                   ` H.J. Lu
2020-07-28 14:01                                     ` Simon Marchi
2020-07-28 14:11                                       ` H.J. Lu
2020-07-28 14:34                                         ` Simon Marchi
2020-07-28 15:05                                           ` H.J. Lu
2020-07-28 15:13                                             ` Simon Marchi
2020-07-28 16:07                                               ` H.J. Lu
2020-07-28 16:28                                                 ` Simon Marchi
2020-07-28 17:26                                                   ` H.J. Lu
2020-07-28 17:43                                                     ` Simon Marchi
2020-07-28 18:31                                                       ` H.J. Lu
2020-07-28 18:47                                                         ` Simon Marchi
2020-07-28 18:57                                                           ` H.J. Lu
2020-07-28 14:54                                         ` Andreas Schwab
2020-07-28 13:53                                 ` H.J. Lu
2020-07-28 13:54                                 ` Simon Marchi [this message]
2020-07-28 12:54                           ` Mark Wielaard
2020-07-28 13:27                             ` [PATCH] PKG_CHECK_MODULES: Properly check " H.J. Lu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3627b719-b2c5-5605-bae8-f444b57f9cb1@simark.ca \
    --to=simark@simark.ca \
    --cc=amerey@redhat.com \
    --cc=binutils@sourceware.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=gdb-patches@sourceware.org \
    --cc=hjl.tools@gmail.com \
    --cc=tom@tromey.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox