mailing list of musl libc
 help / color / mirror / code / Atom feed
fb2b6f88a0f219079e5dd35173849b4623da5992 blob 6673 bytes (raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
 
From 01b58f48c609ec75a77726033503890e4205c605 Mon Sep 17 00:00:00 2001
From: Patrick Oppenlander <patrick.oppenlander@gmail.com>
Date: Mon, 11 Jan 2021 14:24:57 +1100
Subject: [PATCH] math: workaround armv7m clang vfp asm crashes

../../obj_llvm/bin/clang --target=armv7m-linux-musleabihf -std=c99 -nostdinc -ffreestanding -frounding-math -Wa,--noexecstack -D_XOPEN_SOURCE=700 -I../../src_musl/arch/arm -I../../src_musl/arch/generic -Iobj/src/internal -I../../src_musl/src/include -I../../src_musl/src/internal -Iobj/include -I../../src_musl/include  -Os -pipe -fomit-frame-pointer -fno-unwind-tables -fno-asynchronous-unwind-tables -ffunction-sections -fdata-sections -w -Werror=implicit-function-declaration -Werror=implicit-int -Werror=pointer-sign -Werror=pointer-arith -Qunused-arguments -mimplicit-it=always -Wa,-mthumb -DBROKEN_VFP_ASM  -fPIC -c -o obj/src/math/arm/sqrt.lo ../../src_musl/src/math/arm/sqrt.c
PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0.	Program arguments: ../../obj_llvm/bin/clang --target=armv7m-linux-musleabihf -std=c99 -nostdinc -ffreestanding -frounding-math -Wa,--noexecstack -D_XOPEN_SOURCE=700 -I../../src_musl/arch/arm -I../../src_musl/arch/generic -Iobj/src/internal -I../../src_musl/src/include -I../../src_musl/src/internal -Iobj/include -I../../src_musl/include -Os -pipe -fomit-frame-pointer -fno-unwind-tables -fno-asynchronous-unwind-tables -ffunction-sections -fdata-sections -w -Werror=implicit-function-declaration -Werror=implicit-int -Werror=pointer-sign -Werror=pointer-arith -Qunused-arguments -mimplicit-it=always -Wa,-mthumb -DBROKEN_VFP_ASM -fPIC -c -o obj/src/math/arm/sqrt.lo ../../src_musl/src/math/arm/sqrt.c
1.	<eof> parser at end of file
2.	Code generation
3.	Running pass 'Function Pass Manager' on module '../../src_musl/src/math/arm/sqrt.c'.
4.	Running pass 'ARM Instruction Selection' on function '@sqrt'
../../obj_llvm/bin/clang(_ZN4llvm3sys15PrintStackTraceERNS_11raw_ostreamE+0x2a)[0x557581a86b42]
../../obj_llvm/bin/clang(_ZN4llvm3sys17RunSignalHandlersEv+0x34)[0x557581a858ac]
../../obj_llvm/bin/clang(+0x16cc327)[0x557581a3e327]
../../obj_llvm/bin/clang(+0x16cc786)[0x557581a3e786]
/usr/lib/libpthread.so.0(+0x140f0)[0x7fbcbc4760f0]
../../obj_llvm/bin/clang(+0xbcfc9c)[0x557580f41c9c]
../../obj_llvm/bin/clang(_ZNK4llvm12RegsForValue13getCopyToRegsENS_7SDValueERNS_12SelectionDAGERKNS_5SDLocERS1_PS1_PKNS_5ValueENS_3ISD8NodeTypeE+0x2b0)[0x5575820f5c20]
../../obj_llvm/bin/clang(_ZN4llvm19SelectionDAGBuilder14visitInlineAsmERKNS_8CallBaseE+0x1e4c)[0x55758210f5a6]
../../obj_llvm/bin/clang(_ZN4llvm19SelectionDAGBuilder5visitERKNS_11InstructionE+0x60)[0x55758211c954]
../../obj_llvm/bin/clang(_ZN4llvm16SelectionDAGISel16SelectBasicBlockENS_14ilist_iteratorINS_12ilist_detail12node_optionsINS_11InstructionELb0ELb0EvEELb0ELb1EEES6_Rb+0x7d)[0x557582143d05]
../../obj_llvm/bin/clang(_ZN4llvm16SelectionDAGISel20SelectAllBasicBlocksERKNS_8FunctionE+0xe07)[0x557582146397]
../../obj_llvm/bin/clang(_ZN4llvm16SelectionDAGISel20runOnMachineFunctionERNS_15MachineFunctionE+0x572)[0x557582146aa6]
../../obj_llvm/bin/clang(+0xd218e3)[0x5575810938e3]
../../obj_llvm/bin/clang(+0x12260df)[0x5575815980df]
../../obj_llvm/bin/clang(_ZN4llvm13FPPassManager13runOnFunctionERNS_8FunctionE+0x20a)[0x557581774958]
../../obj_llvm/bin/clang(_ZN4llvm13FPPassManager11runOnModuleERNS_6ModuleE+0x2d)[0x557581774cdd]
../../obj_llvm/bin/clang(_ZN4llvm6legacy15PassManagerImpl3runERNS_6ModuleE+0x244)[0x557581774526]
../../obj_llvm/bin/clang(_ZN5clang17EmitBackendOutputERNS_17DiagnosticsEngineERKNS_19HeaderSearchOptionsERKNS_14CodeGenOptionsERKNS_13TargetOptionsERKNS_11LangOptionsERKN4llvm10DataLayoutEPNSE_6ModuleENS_13BackendActionESt10unique_ptrINSE_17raw_pwrite_streamESt14default_deleteISM_EE+0x2e83)[0x557581b95ac0]
../../obj_llvm/bin/clang(+0x1e667c6)[0x5575821d87c6]
../../obj_llvm/bin/clang(_ZN5clang8ParseASTERNS_4SemaEbb+0x29a)[0x5575826800c6]
../../obj_llvm/bin/clang(_ZN5clang14FrontendAction7ExecuteEv+0x55)[0x557581ea6211]
../../obj_llvm/bin/clang(_ZN5clang16CompilerInstance13ExecuteActionERNS_14FrontendActionE+0x5ba)[0x557581e81166]
../../obj_llvm/bin/clang(_ZN5clang25ExecuteCompilerInvocationEPNS_16CompilerInstanceE+0x2fc)[0x557581efbeb8]
../../obj_llvm/bin/clang(_Z8cc1_mainN4llvm8ArrayRefIPKcEES2_Pv+0x848)[0x557580efd525]
../../obj_llvm/bin/clang(+0xb89e71)[0x557580efbe71]
../../obj_llvm/bin/clang(+0x1a7bb68)[0x557581dedb68]
../../obj_llvm/bin/clang(_ZN4llvm20CrashRecoveryContext9RunSafelyENS_12function_refIFvvEEE+0x8b)[0x557581a3e49d]
../../obj_llvm/bin/clang(+0x1a7c1a6)[0x557581dee1a6]
../../obj_llvm/bin/clang(_ZNK5clang6driver11Compilation14ExecuteCommandERKNS0_7CommandERPS3_+0x246)[0x557581dd8ede]
../../obj_llvm/bin/clang(_ZNK5clang6driver11Compilation11ExecuteJobsERKNS0_7JobListERN4llvm15SmallVectorImplISt4pairIiPKNS0_7CommandEEEE+0x64)[0x557581dd8fca]
../../obj_llvm/bin/clang(_ZN5clang6driver6Driver18ExecuteCompilationERNS0_11CompilationERN4llvm15SmallVectorImplISt4pairIiPKNS0_7CommandEEEE+0xbf)[0x557581ddc385]
../../obj_llvm/bin/clang(main+0x19d6)[0x557580e85de8]
/usr/lib/libc.so.6(__libc_start_main+0xf2)[0x7fbcbbee6152]
../../obj_llvm/bin/clang(_start+0x2e)[0x557580efb42e]
clang-11: error: clang frontend command failed due to signal (use -v to see invocation)
clang version 11.0.0 (https://github.com/richfelker/musl-cross-make 79528a0baad2c85087d33075f2ccdbf13dc556dd)
Target: armv7m-unknown-linux-musleabihf
Thread model: posix
InstalledDir: /home/patrick/src/toolchain/musl-cross-make/build-clang/local/obj_musl/armv7m-linux-musleabihf/../../obj_llvm/bin
clang-11: note: diagnostic msg:
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-11: note: diagnostic msg: /tmp/sqrt-71be55.c
clang-11: note: diagnostic msg: /tmp/sqrt-71be55.sh
clang-11: note: diagnostic msg:
---
 src/math/arm/fabs.c | 2 +-
 src/math/arm/sqrt.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/math/arm/fabs.c b/src/math/arm/fabs.c
index f890520a..316ba776 100644
--- a/src/math/arm/fabs.c
+++ b/src/math/arm/fabs.c
@@ -1,6 +1,6 @@
 #include <math.h>
 
-#if __ARM_PCS_VFP
+#if __ARM_PCS_VFP && !BROKEN_VFP_ASM
 
 double fabs(double x)
 {
diff --git a/src/math/arm/sqrt.c b/src/math/arm/sqrt.c
index 874af960..ac1a6ed1 100644
--- a/src/math/arm/sqrt.c
+++ b/src/math/arm/sqrt.c
@@ -1,6 +1,6 @@
 #include <math.h>
 
-#if __ARM_PCS_VFP || (__VFP_FP__ && !__SOFTFP__)
+#if (__ARM_PCS_VFP || (__VFP_FP__ && !__SOFTFP__)) && !BROKEN_VFP_ASM
 
 double sqrt(double x)
 {
-- 
2.30.0

debug log:

solving fb2b6f8 ...
found fb2b6f8 in https://inbox.vuxu.org/musl/CAEg67G=3RVgfYKVjaAiCfGxGeB+TxQ3A6u=XFmuWYhsKvpRAPQ@mail.gmail.com/

applying [1/1] https://inbox.vuxu.org/musl/CAEg67G=3RVgfYKVjaAiCfGxGeB+TxQ3A6u=XFmuWYhsKvpRAPQ@mail.gmail.com/
diff --git a/patches/musl-1.2.1/0001-math-workaround-armv7m-clang-vfp-asm-crashes.patch b/patches/musl-1.2.1/0001-math-workaround-armv7m-clang-vfp-asm-crashes.patch
new file mode 100644
index 0000000..fb2b6f8

1:78: trailing whitespace.
 
1:81: trailing whitespace.
 
1:90: trailing whitespace.
 
1:93: trailing whitespace.
 
1:96: trailing whitespace.
-- 
Checking patch patches/musl-1.2.1/0001-math-workaround-armv7m-clang-vfp-asm-crashes.patch...
Applied patch patches/musl-1.2.1/0001-math-workaround-armv7m-clang-vfp-asm-crashes.patch cleanly.
warning: squelched 1 whitespace error
warning: 6 lines add whitespace errors.

index at:
100644 fb2b6f88a0f219079e5dd35173849b4623da5992	patches/musl-1.2.1/0001-math-workaround-armv7m-clang-vfp-asm-crashes.patch

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).