objcopy issues on Solaris (original) (raw)
Erik Joelsson erik.joelsson at oracle.com
Fri Apr 28 13:33:43 UTC 2017
- Previous message (by thread): objcopy issues on Solaris
- Next message (by thread): objcopy issues on Solaris
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hello,
In jdk8u we still have this workaround for broken gobjcopy in NativeCompilation.gmk:
gobjcopy crashes on "empty" section headers with the SHF_ALLOC flag set.
Use $(FIX_EMPTY_SEC_HDR_FLAGS) to clear the SHF_ALLOC flag (if set) from
empty section headers until a fixed $(OBJCOPY) is available.
An empty section header has sh_addr == 0 and sh_size == 0.
This problem has only been seen on Solaris X64, but we call this tool
on all Solaris builds just in case.
$(OBJCOPY) --add-gnu-debuglink=... corrupts SUNW_* sections.
Use (ADDGNUDEBUGLINK)untilafixed(ADD_GNU_DEBUGLINK) until a fixed (ADDGNUDEBUGLINK)untilafixed(OBJCOPY) is available. ($1_OBJECT_DIR)/$$(LIBRARY_PREFIX)$$($1_LIBRARY).debuginfo : ($1_TARGET) \
<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo stretchy="false">(</mo><mi>F</mi><mi>I</mi><msub><mi>X</mi><mi>E</mi></msub><mi>M</mi><mi>P</mi><mi>T</mi><msub><mi>Y</mi><mi>S</mi></msub><mi>E</mi><msub><mi>C</mi><mi>H</mi></msub><mi>D</mi><msub><mi>R</mi><mi>F</mi></msub><mi>L</mi><mi>A</mi><mi>G</mi><mi>S</mi><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">(FIX_EMPTY_SEC_HDR_FLAGS) </annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mopen">(</span><span class="mord mathnormal" style="margin-right:0.13889em;">F</span><span class="mord mathnormal" style="margin-right:0.07847em;">I</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.07847em;">X</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3283em;"><span style="top:-2.55em;margin-left:-0.0785em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.05764em;">E</span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord mathnormal" style="margin-right:0.13889em;">MPT</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.22222em;">Y</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3283em;"><span style="top:-2.55em;margin-left:-0.2222em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.05764em;">S</span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord mathnormal" style="margin-right:0.05764em;">E</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.07153em;">C</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3283em;"><span style="top:-2.55em;margin-left:-0.0715em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.08125em;">H</span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord mathnormal" style="margin-right:0.02778em;">D</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.00773em;">R</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3283em;"><span style="top:-2.55em;margin-left:-0.0077em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.13889em;">F</span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord mathnormal">L</span><span class="mord mathnormal">A</span><span class="mord mathnormal" style="margin-right:0.05764em;">GS</span><span class="mclose">)</span></span></span></span>(ADD_GNU_DEBUGLINK)
<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo stretchy="false">(</mo><mi>R</mi><mi>M</mi><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">(RM) </annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mopen">(</span><span class="mord mathnormal" style="margin-right:0.10903em;">RM</span><span class="mclose">)</span></span></span></span>$@
<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo stretchy="false">(</mo><mi>F</mi><mi>I</mi><msub><mi>X</mi><mi>E</mi></msub><mi>M</mi><mi>P</mi><mi>T</mi><msub><mi>Y</mi><mi>S</mi></msub><mi>E</mi><msub><mi>C</mi><mi>H</mi></msub><mi>D</mi><msub><mi>R</mi><mi>F</mi></msub><mi>L</mi><mi>A</mi><mi>G</mi><mi>S</mi><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">(FIX_EMPTY_SEC_HDR_FLAGS) </annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mopen">(</span><span class="mord mathnormal" style="margin-right:0.13889em;">F</span><span class="mord mathnormal" style="margin-right:0.07847em;">I</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.07847em;">X</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3283em;"><span style="top:-2.55em;margin-left:-0.0785em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.05764em;">E</span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord mathnormal" style="margin-right:0.13889em;">MPT</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.22222em;">Y</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3283em;"><span style="top:-2.55em;margin-left:-0.2222em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.05764em;">S</span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord mathnormal" style="margin-right:0.05764em;">E</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.07153em;">C</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3283em;"><span style="top:-2.55em;margin-left:-0.0715em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.08125em;">H</span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord mathnormal" style="margin-right:0.02778em;">D</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.00773em;">R</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3283em;"><span style="top:-2.55em;margin-left:-0.0077em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.13889em;">F</span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord mathnormal">L</span><span class="mord mathnormal">A</span><span class="mord mathnormal" style="margin-right:0.05764em;">GS</span><span class="mclose">)</span></span></span></span>(LOG_INFO) <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow></mrow><annotation encoding="application/x-tex"></annotation></semantics></math></span><span class="katex-html" aria-hidden="true"></span></span><
<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo stretchy="false">(</mo><mi>O</mi><mi>B</mi><mi>J</mi><mi>C</mi><mi>O</mi><mi>P</mi><mi>Y</mi><mo stretchy="false">)</mo><mo>−</mo><mo>−</mo><mi>o</mi><mi>n</mi><mi>l</mi><mi>y</mi><mo>−</mo><mi>k</mi><mi>e</mi><mi>e</mi><mi>p</mi><mo>−</mo><mi>d</mi><mi>e</mi><mi>b</mi><mi>u</mi><mi>g</mi></mrow><annotation encoding="application/x-tex">(OBJCOPY) --only-keep-debug </annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mopen">(</span><span class="mord mathnormal" style="margin-right:0.05017em;">OB</span><span class="mord mathnormal" style="margin-right:0.09618em;">J</span><span class="mord mathnormal" style="margin-right:0.13889em;">COP</span><span class="mord mathnormal" style="margin-right:0.22222em;">Y</span><span class="mclose">)</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">−</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:0.8889em;vertical-align:-0.1944em;"></span><span class="mord">−</span><span class="mord mathnormal">o</span><span class="mord mathnormal">n</span><span class="mord mathnormal" style="margin-right:0.01968em;">l</span><span class="mord mathnormal" style="margin-right:0.03588em;">y</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">−</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:0.8889em;vertical-align:-0.1944em;"></span><span class="mord mathnormal" style="margin-right:0.03148em;">k</span><span class="mord mathnormal">ee</span><span class="mord mathnormal">p</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">−</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:0.8889em;vertical-align:-0.1944em;"></span><span class="mord mathnormal">d</span><span class="mord mathnormal">e</span><span class="mord mathnormal">b</span><span class="mord mathnormal" style="margin-right:0.03588em;">ug</span></span></span></span>$< <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow></mrow><annotation encoding="application/x-tex"></annotation></semantics></math></span><span class="katex-html" aria-hidden="true"></span></span>@
<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo stretchy="false">(</mo><mi>C</mi><mi>D</mi><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">(CD) </annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mopen">(</span><span class="mord mathnormal" style="margin-right:0.07153em;">C</span><span class="mord mathnormal" style="margin-right:0.02778em;">D</span><span class="mclose">)</span></span></span></span>$(@D) && <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo stretchy="false">(</mo><mi>A</mi><mi>D</mi><msub><mi>D</mi><mi>G</mi></msub><mi>N</mi><msub><mi>U</mi><mi>D</mi></msub><mi>E</mi><mi>B</mi><mi>U</mi><mi>G</mi><mi>L</mi><mi>I</mi><mi>N</mi><mi>K</mi><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">(ADD_GNU_DEBUGLINK) </annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mopen">(</span><span class="mord mathnormal">A</span><span class="mord mathnormal" style="margin-right:0.02778em;">D</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.02778em;">D</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3283em;"><span style="top:-2.55em;margin-left:-0.0278em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">G</span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord mathnormal" style="margin-right:0.10903em;">N</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.10903em;">U</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3283em;"><span style="top:-2.55em;margin-left:-0.109em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.02778em;">D</span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord mathnormal" style="margin-right:0.05017em;">EB</span><span class="mord mathnormal" style="margin-right:0.10903em;">U</span><span class="mord mathnormal">G</span><span class="mord mathnormal">L</span><span class="mord mathnormal" style="margin-right:0.07847em;">I</span><span class="mord mathnormal" style="margin-right:0.10903em;">N</span><span class="mord mathnormal" style="margin-right:0.07153em;">K</span><span class="mclose">)</span></span></span></span>(LOG_INFO) <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow></mrow><annotation encoding="application/x-tex"></annotation></semantics></math></span><span class="katex-html" aria-hidden="true"></span></span>(@F) <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow></mrow><annotation encoding="application/x-tex"></annotation></semantics></math></span><span class="katex-html" aria-hidden="true"></span></span><
I don't know if this is related to your problem. We were able to remove the above in JDK 9 because gobjcopy in Solaris 11 is not exhibiting this problem for us. The introduction of this workaround is from before my time so I don't know the details. The tools FIX_EMPTY_SEC_HDR_FLAGS and ADD_GNU_DEBUGLINK are in the jdk8u src.
I checked a build machine for jdk8u and it reports "GNU objcopy 2.15" and this seems to be from the default OS package (Solaris 10). We have had problems with bugs in gobjcopy in the past though. (Example https://bugs.openjdk.java.net/browse/JDK-8034021) So try to get all the latest patches for it.
/Erik
On 2017-04-28 14:20, Baesken, Matthias wrote:
GNU objcopy (GNU Binutils) 2.21.1 developer/gnu-binutils at 2.21.1-0.175.1.0.0.24.0 This is a Solaris 11u1 package. Hi David, thanks for the info. But what about Solaris 10 ? https://wiki.openjdk.java.net/display/Build/Supported+Build+Platforms mentions 10u6 supported for JDK8 . And does the 11u1 package developer/gnu-binutils at 2.21.1-0.175.1.0.0.24.0 Contain special objcopy patches ? Best regards, Matthias
-----Original Message----- From: David Holmes [mailto:david.holmes at oracle.com] Sent: Freitag, 28. April 2017 13:24 To: Baesken, Matthias <matthias.baesken at sap.com>; 'build-dev at openjdk.java.net' <build-dev at openjdk.java.net>; Erik Joelsson (erik.joelsson at oracle.com) <erik.joelsson at oracle.com>; 'magnus.ihse.bursie at oracle.com' <magnus.ihse.bursie at oracle.com> Cc: Simonis, Volker <volker.simonis at sap.com>; Reingruber, Richard <richard.reingruber at sap.com> Subject: Re: objcopy issues on Solaris Hi Matthias, On 28/04/2017 7:21 PM, Baesken, Matthias wrote: Hello, we are facing problems with gobjcopy on Solaris 10 x8664. When processing libjvm.so (product build) with FDS and separated debug-infos we are getting :
objcopy: libjvm.debuginfo: Not enough room for program headers, try linking with -N It looks like we are running into this (or a similar) problems : https://bugs.openjdk.java.net/browse/JDK-7165598 As recommended in those bugs : x86 https://bugs.openjdk.java.net/browse/JDK-8034005 (and similar Sparc issue) https://bugs.openjdk.java.net/browse/JDK-8033602 We are using objcopy from binutils-2.28 (downloaded and built ourselves from standard binutils gnu.org page) and still get the mentioned error. In the OpenJDK version checks, 2.21 seems to be needed minimum, the comments in version check says "objcopy prior to 2.21.1 on solaris is broken and is not usable.". Could you tell us the exact version of objcopy / gobjcopy you are using in 8 and 9 on Solaris to process the debuginfo ? And where do you get the gobjcopy from? GNU objcopy (GNU Binutils) 2.21.1 developer/gnu-binutils at 2.21.1-0.175.1.0.0.24.0 This is a Solaris 11u1 package. David ----- Thanks, Richard and Matthias
- Previous message (by thread): objcopy issues on Solaris
- Next message (by thread): objcopy issues on Solaris
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]