http://sourceware.org/bugzilla/show_bug.cgi?id=12742

           Summary: ld error "unrecognized option '-plugin'" on mingw and
                    how to build with plugins enabled on mingw
           Product: binutils
           Version: 2.21
            Status: NEW
          Severity: normal
          Priority: P2
         Component: ld
        AssignedTo: unassig...@sources.redhat.com
        ReportedBy: vanboxem.ru...@gmail.com


Building binutils and gcc with --enable-lto does not, in fact allow it to be
used.

The error message:

ld.exe: unrecognized option '-plugin'

when compiling+linking a simple test file with "g++ -flto main.cpp -o test.exe"

I attempted to rebuild binutils with "--enable-plugins", but the build fails in
libbfd, among other things.

What needs to happen to allow binutils built with "--enable-plugins" on mingw:

1. ld/plugin.c has a code block that defines functions not present on windows
between #if !defined (HAVE_DLFNC_H) && defined (HAVE_DLFNC_H) ... #endif. These
should also be present in bfd/plugin.c. Additionally, the windows.h header
checks should be moved to bfd/configure and bfd/config.h (they are missing)

2. the binutils subdirectory tries to link -ldl, but this isn't right on
Windows, just link -lkernel32 instead for mingw targets/hosts (don't know where
to change that at all).

3. Perhaps enable plugins by default for binutils for mingw after this change
(maybe only if "--enable-lto" is specified)

I wish I could provide a patch, but I'm unable to locate some crucial parts
that need to be modified for this to work.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

_______________________________________________
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils

Reply via email to