* Cross-build issues in gdb/gnulib
@ 2015-08-24 21:20 Paul_Koning
2015-08-25 9:56 ` Pedro Alves
0 siblings, 1 reply; 8+ messages in thread
From: Paul_Koning @ 2015-08-24 21:20 UTC (permalink / raw)
To: gdb
I'm running into strange problems cross-building with V7.7.1; it looks like the same configure machinery is present in later versions as well.
The problem is that the configure script in gdb/gnulib tries to run a number of tests, by building and then executing "conftest". It does so unconditionally, there are no checks for whether this is a cross-build, specifically build = x86_64-linux, host = target = netbsd.
For one of my crossbuilds this "works" because there the host is mips, so attempting to execute conftest fails and the script handles this in a way that produces an acceptable outcome.
But when target is i386-netbsdelf, when the script attempts to execute the (NetBSD) binary for conftest, Linux attempts to do so. I guess it has some flavor of NetBSD emulation. But this is bad for two reasons. First, executing that program on the Linux build system obviously produces an irrelevant answer. Second, and this is what breaks my build, the NetBSD emulation in Linux is defective -- conftest goes into an infinite loop. So my build never finishes.
What can I do about this?
paul
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Cross-build issues in gdb/gnulib
2015-08-24 21:20 Cross-build issues in gdb/gnulib Paul_Koning
@ 2015-08-25 9:56 ` Pedro Alves
2015-08-25 13:12 ` Paul_Koning
0 siblings, 1 reply; 8+ messages in thread
From: Pedro Alves @ 2015-08-25 9:56 UTC (permalink / raw)
To: Paul_Koning, gdb
On 08/24/2015 10:20 PM, Paul_Koning@Dell.com wrote:
> I'm running into strange problems cross-building with V7.7.1; it looks like the same configure machinery is present in later versions as well.
>
> The problem is that the configure script in gdb/gnulib tries to run a number of tests, by building and then executing "conftest". It does so unconditionally, there are no checks for whether this is a cross-build, specifically build = x86_64-linux, host = target = netbsd.
I have no idea why configure is trying to run the test in your case, but I just yesterday
updated master's gnulib copy to current upstream gnulib master. Previously we had
a 2012 copy. I don't see any AC_TRY_RUN in current master, for instance,
though I didn't check older versions. In any case, try seeing if current master makes
a difference.
Thanks,
Pedro Alves
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Cross-build issues in gdb/gnulib
2015-08-25 9:56 ` Pedro Alves
@ 2015-08-25 13:12 ` Paul_Koning
2015-08-25 13:40 ` Pedro Alves
0 siblings, 1 reply; 8+ messages in thread
From: Paul_Koning @ 2015-08-25 13:12 UTC (permalink / raw)
To: palves; +Cc: gdb
> On Aug 25, 2015, at 5:56 AM, Pedro Alves <palves@redhat.com> wrote:
>
> On 08/24/2015 10:20 PM, Paul_Koning@Dell.com wrote:
>> I'm running into strange problems cross-building with V7.7.1; it looks like the same configure machinery is present in later versions as well.
>>
>> The problem is that the configure script in gdb/gnulib tries to run a number of tests, by building and then executing "conftest". It does so unconditionally, there are no checks for whether this is a cross-build, specifically build = x86_64-linux, host = target = netbsd.
>
> I have no idea why configure is trying to run the test in your case, but I just yesterday
> updated master's gnulib copy to current upstream gnulib master. Previously we had
> a 2012 copy. I don't see any AC_TRY_RUN in current master, for instance,
> though I didn't check older versions. In any case, try seeing if current master makes
> a difference.
I tracked down the spot in the configure sources where the problem originates. There is no AC_TRY_RUN involved. Instead, the issue is this bit of code in gnulib/import/m4/locale-ja.m4:
# Test for the AIX locale name.
if (LC_ALL=ja_JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
gt_cv_locale_ja=ja_JP
The comment refers to AIX, but it is in fact executed in the "*" case of a case statement, i.e., for everything other than Windows. The same code pattern also appears in the two other locale-*.m4 files.
So it looks like that code needs some sort of guard checking for cross-build, and some sort of default action if so. I'm not particularly fluent in configure unfortunately.
A quick look at the latest master shows that these files are unchanged by yesterday's update (other than copyright year).
paul
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Cross-build issues in gdb/gnulib
2015-08-25 13:12 ` Paul_Koning
@ 2015-08-25 13:40 ` Pedro Alves
2015-08-25 16:58 ` Paul Eggert
0 siblings, 1 reply; 8+ messages in thread
From: Pedro Alves @ 2015-08-25 13:40 UTC (permalink / raw)
To: Paul_Koning; +Cc: gdb, bug-gnulib
Adding gnulib@
Original thread here:
https://sourceware.org/ml/gdb/2015-08/msg00037.html
Thanks,
Pedro Alves
On 08/25/2015 02:12 PM, Paul_Koning@dell.com wrote:
>
>> On Aug 25, 2015, at 5:56 AM, Pedro Alves <palves@redhat.com> wrote:
>>
>> On 08/24/2015 10:20 PM, Paul_Koning@Dell.com wrote:
>>> I'm running into strange problems cross-building with V7.7.1; it looks like the same configure machinery is present in later versions as well.
>>>
>>> The problem is that the configure script in gdb/gnulib tries to run a number of tests, by building and then executing "conftest". It does so unconditionally, there are no checks for whether this is a cross-build, specifically build = x86_64-linux, host = target = netbsd.
>>
>> I have no idea why configure is trying to run the test in your case, but I just yesterday
>> updated master's gnulib copy to current upstream gnulib master. Previously we had
>> a 2012 copy. I don't see any AC_TRY_RUN in current master, for instance,
>> though I didn't check older versions. In any case, try seeing if current master makes
>> a difference.
>
> I tracked down the spot in the configure sources where the problem originates. There is no AC_TRY_RUN involved. Instead, the issue is this bit of code in gnulib/import/m4/locale-ja.m4:
>
> # Test for the AIX locale name.
> if (LC_ALL=ja_JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
> gt_cv_locale_ja=ja_JP
>
> The comment refers to AIX, but it is in fact executed in the "*" case of a case statement, i.e., for everything other than Windows. The same code pattern also appears in the two other locale-*.m4 files.
>
> So it looks like that code needs some sort of guard checking for cross-build, and some sort of default action if so. I'm not particularly fluent in configure unfortunately.
>
> A quick look at the latest master shows that these files are unchanged by yesterday's update (other than copyright year).
>
> paul
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Cross-build issues in gdb/gnulib
2015-08-25 13:40 ` Pedro Alves
@ 2015-08-25 16:58 ` Paul Eggert
2015-08-25 17:06 ` Paul_Koning
2015-08-25 17:10 ` Paul_Koning
0 siblings, 2 replies; 8+ messages in thread
From: Paul Eggert @ 2015-08-25 16:58 UTC (permalink / raw)
To: Pedro Alves, Paul_Koning; +Cc: gdb, bug-gnulib
Pedro Alves wrote:
> # Test for the AIX locale name.
>> if (LC_ALL=ja_JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
>> gt_cv_locale_ja=ja_JP
>>
>>The comment refers to AIX, but it is in fact executed in the "*" case of a case statement, i.e., for everything other than Windows. The same code pattern also appears in the two other locale-*.m4 files.
I'm lost. Do you have a specific Gnulib patch in mind?
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Cross-build issues in gdb/gnulib
2015-08-25 16:58 ` Paul Eggert
@ 2015-08-25 17:06 ` Paul_Koning
2015-08-25 17:54 ` Pedro Alves
2015-08-25 17:10 ` Paul_Koning
1 sibling, 1 reply; 8+ messages in thread
From: Paul_Koning @ 2015-08-25 17:06 UTC (permalink / raw)
To: eggert; +Cc: palves, gdb, bug-gnulib
> On Aug 25, 2015, at 12:58 PM, Paul Eggert <eggert@cs.ucla.edu> wrote:
>
> Pedro Alves wrote:
>> # Test for the AIX locale name.
>>> if (LC_ALL=ja_JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
>>> gt_cv_locale_ja=ja_JP
>>>
>>> The comment refers to AIX, but it is in fact executed in the "*" case of a case statement, i.e., for everything other than Windows. The same code pattern also appears in the two other locale-*.m4 files.
>
> I'm lost. Do you have a specific Gnulib patch in mind?
I didn't when I wrote that -- all I had was a diagnosis of the underlying bug.
In the meantime I found an autoconf manual and constructed a fix for this issue. I'll send a patch soon, want to do some more testing.
Where should the fix be sent?
paul
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Cross-build issues in gdb/gnulib
2015-08-25 16:58 ` Paul Eggert
2015-08-25 17:06 ` Paul_Koning
@ 2015-08-25 17:10 ` Paul_Koning
1 sibling, 0 replies; 8+ messages in thread
From: Paul_Koning @ 2015-08-25 17:10 UTC (permalink / raw)
To: eggert; +Cc: palves, gdb, bug-gnulib
> On Aug 25, 2015, at 12:58 PM, Paul Eggert <eggert@cs.ucla.edu> wrote:
>
> Pedro Alves wrote:
>> # Test for the AIX locale name.
>>> if (LC_ALL=ja_JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
>>> gt_cv_locale_ja=ja_JP
>>>
>>> The comment refers to AIX, but it is in fact executed in the "*" case of a case statement, i.e., for everything other than Windows. The same code pattern also appears in the two other locale-*.m4 files.
>
> I'm lost. Do you have a specific Gnulib patch in mind?
Perhaps you missed the original problem report, which is that this configure machinery doesn't take into account cross-builds. And that broke badly on a build=X86_64-linux, host=i386-netbsdelf cross-build, because Linux attempted to execute the generated conftest image (a NetBSD image). That's wrong of course, but worse yet, it got into an infinite loop, apparently the emulation is buggy. So my build got stuck.
I learned about AC_RUN_IFELSE and constructed a fix with that.
paul
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Cross-build issues in gdb/gnulib
2015-08-25 17:06 ` Paul_Koning
@ 2015-08-25 17:54 ` Pedro Alves
0 siblings, 0 replies; 8+ messages in thread
From: Pedro Alves @ 2015-08-25 17:54 UTC (permalink / raw)
To: Paul_Koning, eggert; +Cc: gdb, bug-gnulib
On 08/25/2015 06:06 PM, Paul_Koning@dell.com wrote:
>
>> On Aug 25, 2015, at 12:58 PM, Paul Eggert <eggert@cs.ucla.edu> wrote:
>>
>> Pedro Alves wrote:
>>> # Test for the AIX locale name.
>>>> if (LC_ALL=ja_JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
>>>> gt_cv_locale_ja=ja_JP
>>>>
>>>> The comment refers to AIX, but it is in fact executed in the "*" case of a case statement, i.e., for everything other than Windows. The same code pattern also appears in the two other locale-*.m4 files.
>>
>> I'm lost. Do you have a specific Gnulib patch in mind?
>
> I didn't when I wrote that -- all I had was a diagnosis of the underlying bug.
>
> In the meantime I found an autoconf manual and constructed a fix for this issue. I'll send a patch soon, want to do some more testing.
>
> Where should the fix be sent?
To bug-gnulib@gnu.org. I can update gdb's copy once gnulib master has it fixed.
Thanks,
Pedro Alves
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2015-08-25 17:54 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-24 21:20 Cross-build issues in gdb/gnulib Paul_Koning
2015-08-25 9:56 ` Pedro Alves
2015-08-25 13:12 ` Paul_Koning
2015-08-25 13:40 ` Pedro Alves
2015-08-25 16:58 ` Paul Eggert
2015-08-25 17:06 ` Paul_Koning
2015-08-25 17:54 ` Pedro Alves
2015-08-25 17:10 ` Paul_Koning
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox