> > Did you consider just sending dlltool patches upstream? I did but I had 3 reasons for not doing this.
The first was dlltool was very strange, it invoked the assembler to generate each part of the import library and that would never be able to comply with the spec and was just a needless waste of time for short import libs. It would have essentially been a rewrite anyway. So in the end I found it much easier to just write one from scratch ( reusing the parser of course ). My second reason is clang. I currently have a mingw-w64 toolchain with this stack. clang + libc++ + compiler-rt + lld this equates to gcc + libstdc++ + libgcc + binutils. If we want a standalone clang stack using lld we should not have to build binutils just to have dlltool generate some import libs for us. Not only that but we would have to rebuild dlltool for each target defeating the purpose of clang and lld being a multi target toolchain out of the box. With clang we only have to rebuild the crt, libc++ and compiler-rt for each target. The compiler and linker and related tools never have to be rebuilt. using binutils unfortunately breaks this lovely model and increases build times. The third reason was because we could combine this with gendef. Currently we use gendef to go from dll -> def. Now we can use genlib to go from def -> lib. So from within the mingw-w64-tool we now can go from dll -> lib without any external tools. On Thu, Oct 29, 2015 at 2:12 AM, NightStrike <[email protected]> wrote: > Did you consider just sending dlltool patches upstream? > On Oct 28, 2015 8:51 PM, "Martell Malone" <[email protected]> wrote: > >> Hi, >> >> Kai and I discussed this previously but I would like to present to >> everyone a tool to generate import libs based on layout and code structure >> of gendef. >> >> I would like propose >> https://github.com/martell/genlib >> to be merged as part of the mingw-w64 project. >> >> There are a couple of advantages over using this to dlltool. >> >> 1. This tool supports the following targets armv7 aarch64 i686 and x86_64. >> where as dlltool currently supports just i686 and x86_64 >> (and a really old arm target thats not NT) >> >> 2. The target is specified at runtime so one build will do for all >> targets. >> (this will be especially useful for cross compiling) >> >> 3. This tool unlike dlltool complies to the PE/COFF spec 7. >> Import Library Format. so that we can interop with other linkers >> besides ld. >> >> The 2 most common use cases would be >> >> 1. Using llvm's linker lld which is now feature complete for COFF on arm >> x86 and x64. >> 2. Generate an import lib for msvc to use which dlltool could not do. >> >> I'm sure some have noticed but I have added support for building the >> mingw-w64 crt with clang over the last few months. >> With this mingw-w64 becomes linker independant and can be compiled with >> either gcc or clang and is not bound to ld anymore. >> >> I would like to propose we initially have a flag to enable using this >> when building the crt. Some of the autotools experts here may know some >> more on that. This is because currently ld does not support PE/COFF spec 7 >> and does not understand the resulting library. >> >> Ideally it would be great if the maintainers of ld could comply with >> PE/COFF spec 7. Import Library Format. >> Maybe someone could cc the windows ld maintainer on this? >> >> The code much like the other mingw-w64-tools like gendef is not the >> cleanest but I am open to changes and review of course. I have left notes >> in the source for things that should be added and how we might refactor it. >> Feel free to hammer me on this btw. :) >> >> As for the reason this was created. >> Quite simply it was for the vlc media player to migrate to clang from >> msvc or gcc adding support for the armv7 target. So the videolan were the >> sponsors of this work >> >> Hoping to hear from everyone >> Martell >> >> >> ------------------------------------------------------------------------------ >> >> _______________________________________________ >> Mingw-w64-public mailing list >> [email protected] >> https://lists.sourceforge.net/lists/listinfo/mingw-w64-public >> >>
------------------------------------------------------------------------------
_______________________________________________ Mingw-w64-public mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
