Thread: Is there an independent gcc object linker for windows?

  1. #1
    Registered User awsdert's Avatar
    Join Date
    Jan 2015
    Posts
    1,728

    Is there an independent gcc object linker for windows?

    I know linux etc have ld but what about windows? I don't want to need to install the full mingw/mingw64 devkits for what I'm making, I'd even be fine with manually implementing the linker if I have to (though I'd really rather not).

    Basically I've settled on a possible solution for cross-platform development that does not directly hook into the system APIs (separate library for that) and I need a linker for the final step to be available on each system, regardless of if gcc/mingw tool collections are installed. The basic idea is that the object files are distributed within the directory setup I have for each architecture & data model and then have them linked into the final application/library and launched on the host system. Would be the equivalent of

    Code:
    gcc -o $name$(EXE_EXT) $(OTG_DIR)/.paw/$(PAW_OS_ABI)/main.o $(OTG_DIR)/.paw/$(PAW_ABI)/$name/obj1.o $(OTG_DIR)/.paw/$(PAW_ABI)/$name/obj2.o ... -lpaw1 $(LIBS) && ./$name$(EXE_EXT)
    Which naturally means the developer would not need to know the target operating system, just the target architecture and data model which is significantly easier to develop for.

    I know I'll probably have to implement a custom library format eventually for systems that don't have native support for dynamic libraries but that's for a later version of the library and launcher pair, for now I'm hoping to offload that as much as possible without making the entire devkits a pre-requisite.

  2. #2
    Registered User
    Join Date
    May 2009
    Posts
    4,183
    MinGW GCC uses binutils to provide ld just as I think Linux does.

    Tim S.
    "...a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are,in short, a perfect match.." Bill Bryson

  3. #3
    Registered User awsdert's Avatar
    Join Date
    Jan 2015
    Posts
    1,728
    Quote Originally Posted by stahta01 View Post
    MinGW GCC uses binutils to provide ld just as I think Linux does.

    Tim S.
    Thank you, that does look like an acceptable compromise to me, my library's ABI is going to mandate GNU ABI anyways so this looks good enough, I'll see if there's a portable version later but for now it's good to know there's a way for a native paw launcher on windows to fob off the linking step. Since I'll be bookmarking this thread (because I'll probably forget by the time I start the launcher side of things) I'll add a link for what I found here: Binutils
    - GNU Project - Free Software Foundation

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Linker Setting Issue In IDE - Console/Windows?
    By shrink_tubing in forum C++ Programming
    Replies: 2
    Last Post: 03-26-2023, 09:44 AM
  2. Replies: 6
    Last Post: 10-07-2009, 01:00 PM
  3. Replies: 1
    Last Post: 06-27-2008, 06:41 PM
  4. Replies: 18
    Last Post: 09-12-2003, 10:39 PM
  5. object files and linker
    By Peter555 in forum C Programming
    Replies: 2
    Last Post: 04-26-2002, 03:19 PM

Tags for this Thread