diff options
author | Robert Clausecker <fuz@FreeBSD.org> | 2023-06-26 19:43:25 +0000 |
---|---|---|
committer | Robert Clausecker <fuz@FreeBSD.org> | 2023-06-26 23:30:29 +0000 |
commit | cb61cd8b665eccd6764df0ecae01dcaa4b8f5b5f (patch) | |
tree | 3d632bbe60f1e94b87e6c4ebbdfd6e29732d7f71 | |
parent | 0ef9bba398930d4f8cd4b512188b5b8f3e8d4527 (diff) |
devel/orc: work around armv7 libc bug
The armv7 libc has a bug in printf() where printing a denormal double
may cause NUL bytes to be written out. This port tries to write a
diagnostic comment containing such a denormal to a C source file. The
bug causes the source file to be malformed, breaking the port and its
consumers.
Work around the bug by killing the offending part of the diagnostic
comment.
Approved by: portmgr (build fix blanket)
Reviewed by: diizzy
PR: 272229
-rw-r--r-- | devel/orc/Makefile | 1 | ||||
-rw-r--r-- | devel/orc/files/patch-orc_orcprogram-c.c | 19 |
2 files changed, 20 insertions, 0 deletions
diff --git a/devel/orc/Makefile b/devel/orc/Makefile index 3ebbd84bf732..d7f331d03bd6 100644 --- a/devel/orc/Makefile +++ b/devel/orc/Makefile @@ -1,5 +1,6 @@ PORTNAME= orc DISTVERSION= 0.4.34 +PORTREVISION= 1 CATEGORIES= devel MASTER_SITES= http://gstreamer.freedesktop.org/data/src/orc/ diff --git a/devel/orc/files/patch-orc_orcprogram-c.c b/devel/orc/files/patch-orc_orcprogram-c.c new file mode 100644 index 000000000000..e97ca08db3a7 --- /dev/null +++ b/devel/orc/files/patch-orc_orcprogram-c.c @@ -0,0 +1,19 @@ +This patch works around a bug in the armv7 libc where sprintf(buf, "%g", 1.26e-321); +generates a string with an embedded NUL byte, causing broken source code to be +generated (PR272229). + +--- orc/orcprogram-c.c.orig 2023-06-26 19:40:12 UTC ++++ orc/orcprogram-c.c +@@ -825,10 +825,9 @@ c_rule_loadpX (OrcCompiler *p, void *user, OrcInstruct + } + } else if (p->vars[insn->src_args[0]].vartype == ORC_VAR_TYPE_CONST) { + if (p->vars[insn->src_args[0]].size <= 4) { +- ORC_ASM_CODE(p," %s = 0x%08x; /* %d or %gf */\n", dest, ++ ORC_ASM_CODE(p," %s = 0x%08x; /* %d */\n", dest, + (unsigned int)p->vars[insn->src_args[0]].value.i, +- (int)p->vars[insn->src_args[0]].value.i, +- p->vars[insn->src_args[0]].value.f); ++ (int)p->vars[insn->src_args[0]].value.i); + } else { + ORC_ASM_CODE(p," %s = ORC_UINT64_C(0x%08x%08x); /* %gf */\n", dest, + (orc_uint32)(((orc_uint64)p->vars[insn->src_args[0]].value.i)>>32), |