]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUILD: ist: use the literal declaration for ist_lc/ist_uc under TCC
authorWilly Tarreau <w@1wt.eu>
Wed, 24 May 2023 19:31:21 +0000 (21:31 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 24 May 2023 19:33:34 +0000 (21:33 +0200)
TCC doesn't knoow about __attribute__((weak)), it silently ignores it.
We could add a "static" modifier there in this case but we already have
an alternate portable mode that is based on a slightly larger literal
for obsolete linkers (and non-ELF systems) which choke on weak. Let's
just add the test for tcc there and use it in this case.

No backport is needed.

include/import/ist.h

index 1ac23c815dc9294fdfd710e4ae05f1c06121ea29..50df199f19ff99953c508d24d3f32bcdeb8105aa 100644 (file)
        0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, \
 }
 
-#ifdef USE_OBSOLETE_LINKER
+#if defined(USE_OBSOLETE_LINKER) || defined(__TINYC__)
 /* some old linkers and some non-ELF platforms have issues with the weak
- * attribute so we turn these arrays to literals there.
+ * attribute so we turn these arrays to literals there. TCC silently ignores
+ * it so we switch to literal as well.
  */
 #define ist_lc ((const unsigned char[256])_IST_LC)
 #define ist_uc ((const unsigned char[256])_IST_UC)