Differences between OpenJDK 8u and IcedTea8

Florian Weimer fweimer at redhat.com
Fri Jan 10 10:18:18 UTC 2020


* Volker Simonis:

>> May be. I'm on Ubuntu. "ld" on Ubuntu seems to have "--as-needed" as
>> default. This means that when you a command line like "-lXXX YYY.o"
>> you will get undefined symbols in YYY.o if these symbols are satisfied
>> by libXXX.so". The opposite is "--no-as-needed" which still makes
>> libXXX.so a dependency of the resulting output. Do you know if the
>> linker/gcc use "--no-as-needed" as default?
>
> Wanted to ask if you know whether the linker/gcc on RHEL/Fedora  use
> "--no-as-needed" as default?

Recent Fedora is built with --as-needed, but through build flag
injection.  BFD ld still defaults to --as-needed.  So an OpenJDK build
from the command line should be fine.

Generally, in Fedora and downstream, we do not change upstream defaults
by patching or configuring the toolchain with special flags.  The only
exception I know of is the change to the default architecture baseline
(e.g., configuring gcc with --with-arch=zEC12 --with-tune=z13 on s390x
in Fedora) and the generation of asynchronous unwind tables (so that
debuggers and perf tools work well).

This is different for other distributions, which change more of the
defaults directly in the compiler and link editor.  The advantage is
that it produces more consistent distribution builds without per-package
work to ensure proper build flags injection (but without some hardening
quality control, you probably still can't be sure).  The downside is
that you often cannot build software without fixing issues caused by
--as-needed or PIE.

Thanks,
Florian



More information about the jdk8u-dev mailing list