On 11/21/2018 4:57 AM, Ozkan Sezer wrote:
On 11/21/18, Edward Diener <[email protected]> wrote:
On 11/20/2018 11:55 PM, Ozkan Sezer wrote:
On 11/21/18, Edward Diener
<[email protected]> wrote:
On 11/20/2018 10:50 PM, Ozkan Sezer wrote:
On 11/21/18, Edward Diener
<[email protected]> wrote:
I am building an application using clang-7.0 targeting gcc with
mingw-64/gcc-8.1 as the backend. The application shows no errors
compiling or linking. When I try to debug the application I get the
messages from within gdb:

[New Thread 6432.0x1b38]
Mingw-w64 runtime failure:
Unknown pseudo relocation protocol version 65536

When building/running the same application with just mingw-64/gcc-8.1
everything works fine.

I realize that this is a clang-7.0 problem and may well be that I can
not use gcc-8.1 as my clang-7.0 backend for some reason. But I was
wondering if anybody on the mingw-64/gcc side would have any idea what
would cause the run-time error to occur ?


This may be related:
https://sourceware.org/bugzilla/show_bug.cgi?id=23872

If it is the case, you will need an updated binutils
(or manually edit your linker scripts.)

Thanks for the help.

How do I get an updated binutils for mingw.w64 ?

Toolchain builders will need to adopt that change and post
new toolchains

Where is the linker script located in a mingw.w64 distro ?

It is usually at <toolchain_rootdir>/<target>/lib/ldscripts
E.g.: d:\mingw32\i686-w64-mingw32\lib\ldscripts
or d:\mingw64\x86_64-w64-mingw32\lib\ldscripts

For gcc-8.1 x64, let's say, there is an 'ldscripts' directory at
<toolchain_rootdir>\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\x86_64-w64-mingw32\lib\ldscripts.

In that directory is a number of files starting with i386pe. and
i386pep. and the comment for these are that they are linker scripts.

Do I need to alter all of these or just the i386pe.x and i386pep.x files ?

In each file is the line '. = ALIGN(__section_alignment__);' but I also
occasionally see another '. = ALIGN(n);' line occasionally. So how do I
modify the file(s) ?

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commitdiff;h=73af69e74974eaa155eec89867e3ccc77ab39f6d

I think, in all of those scripts, you should find the line (there should
be only one instance of it):
__rt_psrelocs_start = .;

Insert the new alignment directive just before that line.


Unfortunately this did not solve the problem using clang-7.0 with the gcc-8.1 backend. Most probably clang is using its own linker, rather than the mingw-64/gcc linker, and this is causing the problem. In clang-6.0 everything works properly.




_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to