<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/79283>79283</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            DataFlowSanitizer-x86_64 :: custom.cpp: undefined reference to `__isoc23_strtol.dfsan' (and more)
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          mgorny
      </td>
    </tr>
</table>

<pre>
    I'm seeing the following test regression. I haven't bisected it but I suspect it started with 67e0f410ff2dbac83602357619a7c931518afc73 when the test was un-XFAILed. I've reproduced it with 9eb0f86c279f40a792ec27bf0e9b491b8c90a640 (Saturday morning) and 543cf08636f3a3bb55dddba2e8cad787601647ba (today):

```
FAIL: DataFlowSanitizer-x86_64 :: custom.cpp (2172 of 7003)
******************** TEST 'DataFlowSanitizer-x86_64 :: custom.cpp' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
RUN: at line 1: /var/tmp/portage/sys-libs/compiler-rt-sanitizers-19.0.0.9999/work/compiler-rt_build/lib/llvm/19/bin/clang -fsanitize=dataflow  -m64 /var/tmp/portage/sys-libs/compiler-rt-sanitizers-19.0.0.9999/work/compiler-rt/test/dfsan/custom.cpp -o /var/tmp/portage/sys-libs/compiler-rt-sanitizers-19.0.0.9999/work/compiler-rt_build/test/dfsan/X86_64Config/Output/custom.cpp.tmp && DFSAN_OPTIONS="strict_data_dependencies=0" /var/tmp/portage/sys-libs/compiler-rt-sanitizers-19.0.0.9999/work/compiler-rt_build/test/dfsan/X86_64Config/Output/custom.cpp.tmp
+ /var/tmp/portage/sys-libs/compiler-rt-sanitizers-19.0.0.9999/work/compiler-rt_build/lib/llvm/19/bin/clang -fsanitize=dataflow -m64 /var/tmp/portage/sys-libs/compiler-rt-sanitizers-19.0.0.9999/work/compiler-rt/test/dfsan/custom.cpp -o /var/tmp/portage/sys-libs/compiler-rt-sanitizers-19.0.0.9999/work/compiler-rt_build/test/dfsan/X86_64Config/Output/custom.cpp.tmp
/var/tmp/portage/sys-libs/compiler-rt-sanitizers-19.0.0.9999/work/compiler-rt/test/dfsan/custom.cpp:2079:11: warning: 'snprintf' will always be truncated; specified size is 19, but format string expands to at least 26 [-Wformat-truncation]
 2079 |   int r = snprintf(buf, 19, "hello %s, %-d/   %d/%d %f", s, y, m, d,
      | ^
/var/tmp/portage/sys-libs/compiler-rt-sanitizers-19.0.0.9999/work/compiler-rt/test/dfsan/custom.cpp:2237:31: warning: integer literal is too large to be represented in a signed integer type, interpreting as unsigned [-Wimplicitly-unsigned-literal]
 2237 | test_sscanf_chunk((intmax_t)18446744073709551615, "%ju", _buf, 1);
 | ^
/var/tmp/portage/sys-libs/compiler-rt-sanitizers-19.0.0.9999/work/compiler-rt/test/dfsan/custom.cpp:2241:29: warning: integer literal is too large to be represented in a signed integer type, interpreting as unsigned [-Wimplicitly-unsigned-literal]
 2241 | test_sscanf_chunk((size_t)18446744073709551615, "%zu", _buf, 1);
      | ^
/var/tmp/portage/sys-libs/compiler-rt-sanitizers-19.0.0.9999/work/compiler-rt/test/dfsan/custom.cpp:2245:32: warning: integer literal is too large to be represented in a signed integer type, interpreting as unsigned [-Wimplicitly-unsigned-literal]
 2245 | test_sscanf_chunk((ptrdiff_t)18446744073709551615, "%tu", _buf, 1);
 | ^
/var/tmp/portage/sys-libs/compiler-rt-sanitizers-19.0.0.9999/work/compiler-rt/test/dfsan/custom.cpp:2251:38: warning: ISO C++11 does not allow conversion from string literal to 'char *' [-Wwritable-strings]
 2251 |   test_sscanf_chunk((char)'z', "%c", "z", 1);
      |                                      ^
5 warnings generated.
/usr/bin/x86_64-pc-linux-gnu-ld: /var/tmp/portage/sys-libs/compiler-rt-sanitizers-19.0.0.9999/temp/custom-2d641b.o: in function `test_strtol() [clone .dfsan]':
custom.cpp:(.text+0x74a5): undefined reference to `__isoc23_strtol.dfsan'
/usr/bin/x86_64-pc-linux-gnu-ld: custom.cpp:(.text+0x7604): undefined reference to `__isoc23_strtol.dfsan'
/usr/bin/x86_64-pc-linux-gnu-ld: custom.cpp:(.text+0x7725): undefined reference to `__isoc23_strtol.dfsan'
/usr/bin/x86_64-pc-linux-gnu-ld: /var/tmp/portage/sys-libs/compiler-rt-sanitizers-19.0.0.9999/temp/custom-2d641b.o: in function `test_strtoll() [clone .dfsan]':
custom.cpp:(.text+0x7865): undefined reference to `__isoc23_strtoll.dfsan'
/usr/bin/x86_64-pc-linux-gnu-ld: custom.cpp:(.text+0x79c4): undefined reference to `__isoc23_strtoll.dfsan'
/usr/bin/x86_64-pc-linux-gnu-ld: custom.cpp:(.text+0x7ae5): undefined reference to `__isoc23_strtoll.dfsan'
/usr/bin/x86_64-pc-linux-gnu-ld: /var/tmp/portage/sys-libs/compiler-rt-sanitizers-19.0.0.9999/temp/custom-2d641b.o: in function `test_strtoul() [clone .dfsan]':
custom.cpp:(.text+0x7c25): undefined reference to `__isoc23_strtoul.dfsan'
/usr/bin/x86_64-pc-linux-gnu-ld: custom.cpp:(.text+0x7d8d): undefined reference to `__isoc23_strtoul.dfsan'
/usr/bin/x86_64-pc-linux-gnu-ld: custom.cpp:(.text+0x7eb4): undefined reference to `__isoc23_strtoul.dfsan'
/usr/bin/x86_64-pc-linux-gnu-ld: /var/tmp/portage/sys-libs/compiler-rt-sanitizers-19.0.0.9999/temp/custom-2d641b.o: in function `test_strtoull() [clone .dfsan]':
custom.cpp:(.text+0x8005): undefined reference to `__isoc23_strtoull.dfsan'
/usr/bin/x86_64-pc-linux-gnu-ld: custom.cpp:(.text+0x8160): undefined reference to `__isoc23_strtoull.dfsan'
/usr/bin/x86_64-pc-linux-gnu-ld: custom.cpp:(.text+0x827e): undefined reference to `__isoc23_strtoull.dfsan'
/usr/bin/x86_64-pc-linux-gnu-ld: /var/tmp/portage/sys-libs/compiler-rt-sanitizers-19.0.0.9999/temp/custom-2d641b.o: in function `test_sscanf() [clone .dfsan]':
custom.cpp:(.text+0xe324): undefined reference to `__isoc23_sscanf.dfsan'
/usr/bin/x86_64-pc-linux-gnu-ld: custom.cpp:(.text+0xe49d): undefined reference to `__isoc23_sscanf.dfsan'
/usr/bin/x86_64-pc-linux-gnu-ld: custom.cpp:(.text+0xe932): undefined reference to `__isoc23_sscanf.dfsan'
/usr/bin/x86_64-pc-linux-gnu-ld: /var/tmp/portage/sys-libs/compiler-rt-sanitizers-19.0.0.9999/temp/custom-2d641b.o: in function `void test_sscanf_chunk<int>(int, char const*, char*, int) [clone .dfsan]':
custom.cpp:(.text._Z17test_sscanf_chunkIiEvT_PKcPci.dfsan[_Z17test_sscanf_chunkIiEvT_PKcPci]+0x325): undefined reference to `__isoc23_sscanf.dfsan'
/usr/bin/x86_64-pc-linux-gnu-ld: /var/tmp/portage/sys-libs/compiler-rt-sanitizers-19.0.0.9999/temp/custom-2d641b.o: in function `void test_sscanf_chunk<long>(long, char const*, char*, int) [clone .dfsan]':
custom.cpp:(.text._Z17test_sscanf_chunkIlEvT_PKcPci.dfsan[_Z17test_sscanf_chunkIlEvT_PKcPci]+0x326): undefined reference to `__isoc23_sscanf.dfsan'
/usr/bin/x86_64-pc-linux-gnu-ld: /var/tmp/portage/sys-libs/compiler-rt-sanitizers-19.0.0.9999/temp/custom-2d641b.o:custom.cpp:(.text._Z17test_sscanf_chunkIcEvT_PKcPci.dfsan[_Z17test_sscanf_chunkIcEvT_PKcPci]+0x324): more undefined references to `__isoc23_sscanf.dfsan' follow
clang: error: linker command failed with exit code 1 (use -v to see invocation)

--

********************
```

This is Gentoo amd64, glibc 2.38-r9.

CC @MaskRay 
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzsWl1v2zgW_TX0y4UMifp-8EMcx4tgd9ti0sUO9sWgyCubU4o0SMqO--sXlOym6WbauJl87GACQ6IkivfynHNJXjHMObnWiDOSz0m-mLDeb4yddWtj9WHSGHGYXRNaduAQpV6D3yC0RimzH67QebC4tuicNHoK17Bh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