public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Hans L <thehans@gmail.com>
To: binutils@sourceware.org
Subject: Possible to compress debug symbols in a PE exe? (ld final link failed: bad value)
Date: Tue, 1 Mar 2022 14:17:32 -0600	[thread overview]
Message-ID: <CAFoRp-MWfdxF52iMfrrvZCZp1+0yH9uFX76KeFGnCzGuy+5+Cg@mail.gmail.com> (raw)

I am cross compiling an application from Linux to Windows, where the build
uses MXE ( https://mxe.cc/ ) to bootstrap the GCC / Mingw-w64 based
cross-toolchain, as well as build various library dependencies which get
statically linked with the final executable.

The application builds successfully under normal conditions, but debug
builds are much larger than I would like them to be.  (About 1GB in size,
as opposed to 44MB without debug)
So I wanted to see if compression could help get the filesize down to
something more reasonable by adding gcc flag "-gz" in my CMakeLists.txt

This results in the build failing on the final step with the message:
  /mxe/usr/bin/x86_64-w64-mingw32.static.posix-ld: final link failed: bad
value

What is the meaning of this supremely unhelpful error message?
Is there something about PE format that is not capable of supporting
compressed DWARF symbols?
Have I run into a possible bug in ld?
Or something else entirely is going on? (random guess: must the statically
linked libraries themselves be built with the same "-gz" flag ?)

Thanks for any help,
Hans Loeblich

             reply	other threads:[~2022-03-01 20:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-01 20:17 Hans L [this message]
2022-03-01 20:50 ` Hannes Domani

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAFoRp-MWfdxF52iMfrrvZCZp1+0yH9uFX76KeFGnCzGuy+5+Cg@mail.gmail.com \
    --to=thehans@gmail.com \
    --cc=binutils@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).