Discussion:
[PATCH] 2.31 breaks build of 'gold' for x86_64-w64-mingw32
Alexey Neyman
2018-10-07 20:50:14 UTC
Permalink
Hi,

Canadian cross for x86_64-w64-mingw32 host (in crosstool-NG) has been
failing to build gold because the mkdtemp and link functions are not
available.

Patch attached. Replacement code for mkdtemp stolen from
binutils/bucomm.c; link() call is just placed under an appropriate
ifdef, as the function already has a fallback (copying the file).

Regards,
Alexey.
Cary Coutant
2018-10-24 01:03:02 UTC
Permalink
Post by Alexey Neyman
Patch attached. Replacement code for mkdtemp stolen from
binutils/bucomm.c; link() call is just placed under an appropriate
ifdef, as the function already has a fallback (copying the file).
+AC_CHECK_FUNCS(chsize mmap link)
...
AC_CHECK_FUNCS(mallinfo posix_fallocate fallocate readv sysconf times)
+AC_CHECK_FUNC([mkdtemp],
+ AC_DEFINE([HAVE_MKDTEMP], 1,
+ [Define to 1 if you have the `mkdtemp' function.]))

Is there a reason why you didn't just add mkdtemp to one of the
AC_CHECK_FUNCS macros?

-cary
Alexey Neyman
2018-10-30 05:10:21 UTC
Permalink
Post by Cary Coutant
Post by Alexey Neyman
Patch attached. Replacement code for mkdtemp stolen from
binutils/bucomm.c; link() call is just placed under an appropriate
ifdef, as the function already has a fallback (copying the file).
+AC_CHECK_FUNCS(chsize mmap link)
..
AC_CHECK_FUNCS(mallinfo posix_fallocate fallocate readv sysconf times)
+AC_CHECK_FUNC([mkdtemp],
+ AC_DEFINE([HAVE_MKDTEMP], 1,
+ [Define to 1 if you have the `mkdtemp' function.]))
Is there a reason why you didn't just add mkdtemp to one of the
AC_CHECK_FUNCS macros?
No specific reason, just copy-pasted from the same check in
binutils/configure.ac.

Included into the AC_CHECK_FUNCS right above; updated patch attached.

Regards,
Alexey.
Cary Coutant
2018-11-07 19:05:58 UTC
Permalink
Post by Alexey Neyman
Included into the AC_CHECK_FUNCS right above; updated patch attached.
* gold/configure.ac: Add checks for link, mkdtemp.
* gold/configure: Regenerated.
* gold/config.in: Regenerated.
* gold/plugin.cc (Plugin_recorder::init): Fall back to mktemp
if mkdtemp is not available.
(link_or_copy_file): Fall back to copy if link() is not available.

This is OK. Thanks!

-cary
Alexey Neyman
2018-11-07 20:10:07 UTC
Permalink
Post by Cary Coutant
Post by Alexey Neyman
Included into the AC_CHECK_FUNCS right above; updated patch attached.
* gold/configure.ac: Add checks for link, mkdtemp.
* gold/configure: Regenerated.
* gold/config.in: Regenerated.
* gold/plugin.cc (Plugin_recorder::init): Fall back to mktemp
if mkdtemp is not available.
(link_or_copy_file): Fall back to copy if link() is not available.
This is OK. Thanks!
I noticed that I accidentally attached the first version of the patch,
not updated (forgot to copy the updated patch from the build machine).

Really, really updated patch attached now :)

Sorry about this confusion,
Alexey.
Alexey Neyman
2018-12-04 01:34:42 UTC
Permalink
Kind reminder... Can anyone commit this patch if it is OK?

Regards,
Alexey.



-------- Forwarded Message --------
Subject: Re: [PATCH] 2.31 breaks build of 'gold' for x86_64-w64-mingw32
Date: Wed, 7 Nov 2018 12:10:07 -0800
Post by Cary Coutant
Post by Alexey Neyman
Included into the AC_CHECK_FUNCS right above; updated patch attached.
* gold/configure.ac: Add checks for link, mkdtemp.
* gold/configure: Regenerated.
* gold/config.in: Regenerated.
* gold/plugin.cc (Plugin_recorder::init): Fall back to mktemp
if mkdtemp is not available.
(link_or_copy_file): Fall back to copy if link() is not available.
This is OK. Thanks!
I noticed that I accidentally attached the first version of the patch,
not updated (forgot to copy the updated patch from the build machine).

Really, really updated patch attached now :)

Sorry about this confusion,
Alexey.
Cary Coutant
2018-12-04 07:53:34 UTC
Permalink
Post by Alexey Neyman
Kind reminder... Can anyone commit this patch if it is OK?
Post by Cary Coutant
* gold/configure.ac: Add checks for link, mkdtemp.
* gold/configure: Regenerated.
* gold/config.in: Regenerated.
* gold/plugin.cc (Plugin_recorder::init): Fall back to mktemp
if mkdtemp is not available.
(link_or_copy_file): Fall back to copy if link() is not available.
This is OK. Thanks!
I've added PR gold/23594 to the ChangeLog and committed the patch on
your behalf.

-cary

Loading...