Re: [Mingw-users] libaddr2line.a: dependencies of libbfd.a?
- Date: Tue, 4 Oct 2016 11:15:43 +0200
- From: "Jannick" <thirdedition@xxxxxxx>
- Subject: Re: [Mingw-users] libaddr2line.a: dependencies of libbfd.a?
On Oct 04, 2016 at 09:20 AM, Jannick wrote:
> > > From: Keith Marshall <keithmarshall@xxxxxxxxxxxxxxxxxxxxx>
> > > Date: Mon, 3 Oct 2016 23:15:42 +0100
> > >
> > > > Thanks - agree. However, this package comes along with the implied
> > > > dependency to libintl-8.dll which, in general, I wanted to avoid.
> > >
> > > You'll need to provide a SSCCE, to help me understand where that
> > > dependency arises; I'm not seeing it in my build trees, for either
> > > the distributed libbfd.a or libiberty.a, (when inspected using
> > > "objdump -x ... | grep -i dll" -- not that I'd really expect it to
> > > show up, within a static library, until the linker finds a symbol
> > > dependency which needs the DLL in question).
> Sure. Compile main.c below with
> mingw32-gcc main.c -o t.exe -lbfd -liberty -lintl -lz
> to see that t.exe is dependent on libintl-8.dll.
I should refine my objective which is why to exclude the intl dependency: My
intention is to produce a stand-alone executable, i.e. an executable with
references to pure Windows dlls only which are available on - hopefully -
every Windows machine; I guess this means '-static' in c lingo.
Now, after saying 'set PATH=' I discovered that t.exe (compiled with '
mingw32-gcc main.c -o t.exe -lbfd -liberty -lintl -lz ') depends on another
non-Windows dll (corresponding to libiconv.a). I amended this by linking
with '-static' and including '-liconv', i.e.
mingw32-gcc.exe main.c -o t.exe -static -lbfd -liberty -lintl
which produces a 'stand-alone executable'.
BTW: Is there an easy standard *one-step* approach to determine the complete
dependency graph of (non-Windows) libraries to be linked with given the
'root libraries' which are linked in the first place? In the example
above/below that would mean that the libraries 'libiberty.a', 'libintl.a',
'libiconv.a' and 'libz.a' are spit out somehow given the root library
As a side remark, compiling the GNU binutils package from scratch with an
I could turn off the dependency on intl.
> #define PACKAGE "your-program-name"
> #define PACKAGE_VERSION "1.2.3"
> #include <stdio.h>
> #include <bfd.h>
> int main(int argc, char** argv)
> char* fn=argv;
> printf("exe: '%s'\n", fn);
> bfd* file = bfd_openr(fn, 0);
> if (!file)
> return 1;
> if (bfd_check_format(file, bfd_object))
> printf("object file\n");
> printf("not object file\n");
> return 0;
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
MinGW-users mailing list
This list observes the Etiquette found at
We ask that you be polite and do the same. Disregard for the list etiquette may cause your account to be moderated.
You may change your MinGW Account Options or unsubscribe at: