[libcxx-commits] [libcxx] [libc++] Fix initialization-order-fiasco with iostream.cpp constructors (PR #126995)

Vitaly Buka via libcxx-commits libcxx-commits at lists.llvm.org
Thu Feb 13 12:31:40 PST 2025


================
@@ -0,0 +1,19 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include <iostream>
+
+extern "C" const char* __asan_default_options() { return "check_initialization_order=true:strict_init_order=true"; }
----------------
vitalybuka wrote:

Will not be enough. Tried on local build. Somewhere in the middle libc++ lit setup filters out "env".
Other components allow ASAN stuff pass through, but, last time I checked, not libc++.

I don't think we can do that in this patch without additional testing. It may require fixing some tests, as out bots run with env with stricter set of options.

Maybe we can file a new issue, and look into that later? I would not be able to do so in the next couple of weeks.

Would you prefer land this as is, and remove __asan_default_options later, or remove now and expect proper env  in future?

https://github.com/llvm/llvm-project/pull/126995


More information about the libcxx-commits mailing list