<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>183072</bug_id>
          
          <creation_ts>2018-02-22 20:17:11 -0800</creation_ts>
          <short_desc>Clang reports undefined reference errors of poison variables while building LLIntOffsetsExtractor with -gsplit-dwarf</short_desc>
          <delta_ts>2022-02-28 12:14:19 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>JavaScriptCore</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>INVALID</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>145121</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Fujii Hironori">fujii</reporter>
          <assigned_to name="Fujii Hironori">fujii</assigned_to>
          <cc>ews-watchlist</cc>
    
    <cc>keith_miller</cc>
    
    <cc>mark.lam</cc>
    
    <cc>msaboff</cc>
    
    <cc>saam</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1401638</commentid>
    <comment_count>0</comment_count>
    <who name="Fujii Hironori">fujii</who>
    <bug_when>2018-02-22 20:17:11 -0800</bug_when>
    <thetext>CC=clang-5.0 CXX=clang++-5.0 ./Tools/Scripts/build-webkit --gtk --debug

&gt; [1/2400] Linking CXX executable bin/LLIntOffsetsExtractor
&gt; FAILED: bin/LLIntOffsetsExtractor 
&gt; : &amp;&amp; /usr/bin/clang++-5.0  -fdiagnostics-color=always -fcolor-diagnostics -Wno-parentheses-equality -Wno-noexcept-type -Qunused-arguments -Wwrite-strings -Wundef -Wpointer-arith -Wmissing-format-attribute -Wformat-security -Wcast-align -Wextra -Wall  -fno-strict-aliasing -fno-exceptions -std=c++14 -fno-rtti -gsplit-dwarf -g  -L/home/fujii/work/webkit/ga/WebKitBuild/DependenciesGTK/Root/lib -fuse-ld=gold -Wl,--disable-new-dtags -Wl,--gdb-index   -rdynamic Source/JavaScriptCore/CMakeFiles/LLIntOffsetsExtractor.dir/llint/LLIntOffsetsExtractor.cpp.o  -o bin/LLIntOffsetsExtractor  lib/libWTFGTK.a lib/libbmalloc.a -ldl -licudata -licui18n -licuuc -lpthread -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lz &amp;&amp; :
&gt; Source/JavaScriptCore/CMakeFiles/LLIntOffsetsExtractor.dir/llint/LLIntOffsetsExtractor.cpp.o(.debug_addr+0x8): error: undefined reference to &apos;g_NativeCodePoison&apos;
&gt; Source/JavaScriptCore/CMakeFiles/LLIntOffsetsExtractor.dir/llint/LLIntOffsetsExtractor.cpp.o(.debug_addr+0x10): error: undefined reference to &apos;g_JITCodePoison&apos;
&gt; Source/JavaScriptCore/CMakeFiles/LLIntOffsetsExtractor.dir/llint/LLIntOffsetsExtractor.cpp.o(.debug_addr+0x18): error: undefined reference to &apos;g_UnlinkedSourceCodePoison&apos;
&gt; Source/JavaScriptCore/CMakeFiles/LLIntOffsetsExtractor.dir/llint/LLIntOffsetsExtractor.cpp.o(.debug_addr+0x20): error: undefined reference to &apos;g_JSFunctionPoison&apos;
&gt; Source/JavaScriptCore/CMakeFiles/LLIntOffsetsExtractor.dir/llint/LLIntOffsetsExtractor.cpp.o(.debug_addr+0x28): error: undefined reference to &apos;g_GlobalDataPoison&apos;
&gt; Source/JavaScriptCore/CMakeFiles/LLIntOffsetsExtractor.dir/llint/LLIntOffsetsExtractor.cpp.o(.debug_addr+0x30): error: undefined reference to &apos;g_JSGlobalObjectPoison&apos;
&gt; Source/JavaScriptCore/CMakeFiles/LLIntOffsetsExtractor.dir/llint/LLIntOffsetsExtractor.cpp.o(.debug_addr+0x38): error: undefined reference to &apos;g_CodeBlockPoison&apos;
&gt; clang: error: linker command failed with exit code 1 (use -v to see invocation)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1401654</commentid>
    <comment_count>1</comment_count>
    <who name="Fujii Hironori">fujii</who>
    <bug_when>2018-02-22 22:32:14 -0800</bug_when>
    <thetext>I created a reduced LLIntOffsetsExtractor.cpp:
https://gist.github.com/fujii/9940945fc788aba2577e41eb06ec7271

This is caused by -gsplit-dwarf.

&gt; fujii@ubuntu $ clang++-5.0 -std=c++14 -gsplit-dwarf  LLIntOffsetsExtractor.cpp
&gt; /tmp/LLIntOffsetsExtractor-15eec5.o:(.debug_addr+0x0): undefined reference to `g_JITCodePoison&apos;
&gt; clang: error: linker command failed with exit code 1 (use -v to see invocation)
&gt; fujii@ubuntu $ clang++-5.0 -std=c++14  LLIntOffsetsExtractor.cpp
&gt; fujii@ubuntu $

This is a document about .debug_addr.
https://gcc.gnu.org/wiki/DebugFission</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1401655</commentid>
    <comment_count>2</comment_count>
    <who name="Fujii Hironori">fujii</who>
    <bug_when>2018-02-22 22:36:30 -0800</bug_when>
    <thetext>GTK port release builds has no problem because it doesn&apos;t use -gsplit-dwarf.

&gt; [1/1] : &amp;&amp; /usr/bin/clang++-5.0  -fdiagnostics-color=always -fcolor-diagnostics -Wno-parentheses-equality -Wno-noexcept-type -Qunused-arguments -Wwrite-strings -Wundef -Wpointer-arith -Wmissing-format-attribute -Wformat-security -Wcast-align -Wextra -Wall  -fno-strict-aliasing -fno-exceptions -std=c++14 -fno-rtti -O3 -DNDEBUG  -L/home/fujii/work/webkit/ga/WebKitBuild/DependenciesGTK/Root/lib -fuse-ld=gold -Wl,--disable-new-dtags   -rdynamic Source/JavaScriptCore/CMakeFiles/LLIntOffsetsExtractor.dir/llint/LLIntOffsetsExtractor.cpp.o  -o bin/LLIntOffsetsExtractor  lib/libWTFGTK.a lib/libbmalloc.a -ldl -licudata -licui18n -licuuc -lpthread -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lz &amp;&amp; :</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1401656</commentid>
    <comment_count>3</comment_count>
    <who name="Fujii Hironori">fujii</who>
    <bug_when>2018-02-22 22:38:47 -0800</bug_when>
    <thetext>GCC doesn&apos;t seem to have this issue.

$ g++-7 -std=c++14 -gsplit-dwarf  LLIntOffsetsExtractor.cpp</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1401661</commentid>
    <comment_count>4</comment_count>
      <attachid>334505</attachid>
    <who name="Fujii Hironori">fujii</who>
    <bug_when>2018-02-22 22:48:58 -0800</bug_when>
    <thetext>Created attachment 334505
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1401662</commentid>
    <comment_count>5</comment_count>
    <who name="EWS Watchlist">ews-watchlist</who>
    <bug_when>2018-02-22 22:51:48 -0800</bug_when>
    <thetext>Attachment 334505 did not pass style-queue:


ERROR: Source/JavaScriptCore/llint/LLIntOffsetsExtractor.cpp:68:  POISON_KEY_NAME is incorrectly named. Don&apos;t use underscores in your identifier names.  [readability/naming/underscores] [4]
Total errors found: 1 in 2 files


If any of these errors are false positives, please file a bug against check-webkit-style.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1401663</commentid>
    <comment_count>6</comment_count>
      <attachid>334505</attachid>
    <who name="Mark Lam">mark.lam</who>
    <bug_when>2018-02-22 23:08:26 -0800</bug_when>
    <thetext>Comment on attachment 334505
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=334505&amp;action=review

&gt; Source/JavaScriptCore/llint/LLIntOffsetsExtractor.cpp:69
&gt; +#define DEFINE_POISON(poisonID) \
&gt; +    uintptr_t POISON_KEY_NAME(poisonID);
&gt; +FOR_EACH_JSC_POISON(DEFINE_POISON)

Why is this necessary at all?  We don&apos;t ever use these as offsets.  So, I find it suspicious that we need them here.

Secondly, the LLInt asm code only refers to them as global addresses that should come from the JavaScriptCore library.  Fabricating a second set of such variables here in LLIntOffsetsExtractor will only at best stop the compiler from complaining, but any addresses or offsets generated from these will have nothing to do with the versions in the JavaScriptCore library.  As such, you&apos;ll definitely be getting wrong values.  Hence, I&apos;m not sure that this is not the right solution.  r- for now.

Can you explain what -gsplit-dwarf is and what does it have to do with triggering this issue?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1846723</commentid>
    <comment_count>7</comment_count>
    <who name="Fujii Hironori">fujii</who>
    <bug_when>2022-02-28 12:14:19 -0800</bug_when>
    <thetext>I don&apos;t see this issue with the latest GTK port. Closed as INVALID.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>334505</attachid>
            <date>2018-02-22 22:48:58 -0800</date>
            <delta_ts>2022-02-27 23:30:08 -0800</delta_ts>
            <desc>Patch</desc>
            <filename>bug-183072-20180222224839.patch</filename>
            <type>text/plain</type>
            <size>1390</size>
            <attacher name="Fujii Hironori">fujii</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogMjI4Nzc2CmRpZmYgLS1naXQgYS9Tb3VyY2UvSmF2YVNjcmlw
dENvcmUvQ2hhbmdlTG9nIGIvU291cmNlL0phdmFTY3JpcHRDb3JlL0NoYW5nZUxvZwppbmRleCA4
ZDNkZTAxYWUzY2Y0ZDE5N2M5YjIzMjcxOGE1ZmEzZGRkZDY4NzBmLi41ZTZiYjNhYmVlYmM2NDNl
ODU3ZTVmYjMxNjRmMjFjY2RlZGRmYmE2IDEwMDY0NAotLS0gYS9Tb3VyY2UvSmF2YVNjcmlwdENv
cmUvQ2hhbmdlTG9nCisrKyBiL1NvdXJjZS9KYXZhU2NyaXB0Q29yZS9DaGFuZ2VMb2cKQEAgLTEs
MyArMSwxMiBAQAorMjAxOC0wMi0yMiAgRnVqaWkgS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CAtNjQsNiArNjQsMTAgQEAKIAogbmFtZXNwYWNlIEpTQyB7
CiAKKyNkZWZpbmUgREVGSU5FX1BPSVNPTihwb2lzb25JRCkgXAorICAgIHVpbnRwdHJfdCBQT0lT
T05fS0VZX05BTUUocG9pc29uSUQpOworRk9SX0VBQ0hfSlNDX1BPSVNPTihERUZJTkVfUE9JU09O
KQorCiAjZGVmaW5lIE9GRkxJTkVfQVNNX09GRlNFVE9GKGNsYXp6LCBmaWVsZCkgKHN0YXRpY19j
YXN0PHVuc2lnbmVkPihPQkpFQ1RfT0ZGU0VUT0YoY2xhenosIGZpZWxkKSkpCiAKIGNsYXNzIExM
SW50T2Zmc2V0c0V4dHJhY3RvciB7Cg==
</data>
<flag name="review"
          id="353267"
          type_id="1"
          status="-"
          setter="mark.lam"
    />
          </attachment>
      

    </bug>

</bugzilla>