void HexagonToolChain::addClangTargetOptions(const ArgList &DriverArgs,
ArgStringList &CC1Args,
Action::OffloadKind) const {
- bool UseInitArrayDefault = false;
+
+ bool UseInitArrayDefault = getTriple().isMusl();
if (!DriverArgs.hasFlag(options::OPT_fuse_init_array,
options::OPT_fno_use_init_array,
// CHECK089: "/hexagon{{/|\\\\}}lib{{/|\\\\}}crt1.o"
// CHECK089-NOT: -lclang_rt.builtins-hexagon
// CHECK089-NOT: -lc
+// -----------------------------------------------------------------------------
+// Not Passing -fno-use-init-array when musl is selected
+// -----------------------------------------------------------------------------
+// RUN: %clang -### -target hexagon-unknown-linux-musl \
+// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
+// RUN: -mcpu=hexagonv60 \
+// RUN: %s 2>&1 \
+// RUN: | FileCheck -check-prefix=CHECK090 %s
+// CHECK090-NOT: -fno-use-init-array
+// -----------------------------------------------------------------------------