[PATCH] 2.31 breaks build of 'gold' for x86_64-w64-mingw32

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH] 2.31 breaks build of 'gold' for x86_64-w64-mingw32

Alexey Neyman
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.


0001-Restore-build-on-x86_64-w64-mingw32.patch (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] 2.31 breaks build of 'gold' for x86_64-w64-mingw32

Cary Coutant-3
> 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
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] 2.31 breaks build of 'gold' for x86_64-w64-mingw32

Alexey Neyman


On 10/23/2018 06:03 PM, Cary Coutant wrote:

>> 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.

0001-Restore-build-on-x86_64-w64-mingw32.patch (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] 2.31 breaks build of 'gold' for x86_64-w64-mingw32

Cary Coutant-3
> 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
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] 2.31 breaks build of 'gold' for x86_64-w64-mingw32

Alexey Neyman

On 11/07/2018 11:05 AM, Cary Coutant wrote:
>> 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.

0001-Restore-build-on-x86_64-w64-mingw32.patch (3K) Download Attachment