Fossil SCM
Make sure that "fossil_strcmp" is used everywhere in stead of "strcmp": The "strcmp" function from the C library is not usable in all situations, e.g. with --static on Linux Do an #undef in printf.c, preventing that the fossil_strcmp function is optimized for non-null arguments.
Commit
afffe486433251f3e9675e566c62849f38e09f7c
Parent
7d237c49f3a2213…
3 files changed
+1
-1
+5
+5
+1
-1
| --- Makefile.in | ||
| +++ Makefile.in | ||
| @@ -37,11 +37,11 @@ | ||
| 37 | 37 | # care about testing the end result, this can be blank. |
| 38 | 38 | # |
| 39 | 39 | TCLSH = tclsh |
| 40 | 40 | |
| 41 | 41 | LIB = @LDFLAGS@ @EXTRA_LDFLAGS@ @LIBS@ |
| 42 | -TCC += @EXTRA_CFLAGS@ @CPPFLAGS@ @CFLAGS@ -DHAVE_AUTOCONFIG_H | |
| 42 | +TCC += @EXTRA_CFLAGS@ @CPPFLAGS@ @CFLAGS@ -DHAVE_AUTOCONFIG_H -Dstrcmp=fossil_strcmp | |
| 43 | 43 | INSTALLDIR = $(DESTDIR)@prefix@/bin |
| 44 | 44 | USE_SYSTEM_SQLITE = @USE_SYSTEM_SQLITE@ |
| 45 | 45 | FOSSIL_ENABLE_TCL = @FOSSIL_ENABLE_TCL@ |
| 46 | 46 | FOSSIL_ENABLE_TCL_STUBS = @FOSSIL_ENABLE_TCL_STUBS@ |
| 47 | 47 | |
| 48 | 48 |
| --- Makefile.in | |
| +++ Makefile.in | |
| @@ -37,11 +37,11 @@ | |
| 37 | # care about testing the end result, this can be blank. |
| 38 | # |
| 39 | TCLSH = tclsh |
| 40 | |
| 41 | LIB = @LDFLAGS@ @EXTRA_LDFLAGS@ @LIBS@ |
| 42 | TCC += @EXTRA_CFLAGS@ @CPPFLAGS@ @CFLAGS@ -DHAVE_AUTOCONFIG_H |
| 43 | INSTALLDIR = $(DESTDIR)@prefix@/bin |
| 44 | USE_SYSTEM_SQLITE = @USE_SYSTEM_SQLITE@ |
| 45 | FOSSIL_ENABLE_TCL = @FOSSIL_ENABLE_TCL@ |
| 46 | FOSSIL_ENABLE_TCL_STUBS = @FOSSIL_ENABLE_TCL_STUBS@ |
| 47 | |
| 48 |
| --- Makefile.in | |
| +++ Makefile.in | |
| @@ -37,11 +37,11 @@ | |
| 37 | # care about testing the end result, this can be blank. |
| 38 | # |
| 39 | TCLSH = tclsh |
| 40 | |
| 41 | LIB = @LDFLAGS@ @EXTRA_LDFLAGS@ @LIBS@ |
| 42 | TCC += @EXTRA_CFLAGS@ @CPPFLAGS@ @CFLAGS@ -DHAVE_AUTOCONFIG_H -Dstrcmp=fossil_strcmp |
| 43 | INSTALLDIR = $(DESTDIR)@prefix@/bin |
| 44 | USE_SYSTEM_SQLITE = @USE_SYSTEM_SQLITE@ |
| 45 | FOSSIL_ENABLE_TCL = @FOSSIL_ENABLE_TCL@ |
| 46 | FOSSIL_ENABLE_TCL_STUBS = @FOSSIL_ENABLE_TCL_STUBS@ |
| 47 | |
| 48 |
+5
| --- src/printf.c | ||
| +++ src/printf.c | ||
| @@ -15,10 +15,15 @@ | ||
| 15 | 15 | ** |
| 16 | 16 | ******************************************************************************* |
| 17 | 17 | ** |
| 18 | 18 | ** An implementation of printf() with extra conversion fields. |
| 19 | 19 | */ |
| 20 | + | |
| 21 | +/* prevent "fossil_strcmp" to be optimized using the assumption | |
| 22 | + * that its arguments cannot be NULL */ | |
| 23 | +#undef fossil_strcmp | |
| 24 | + | |
| 20 | 25 | #include "config.h" |
| 21 | 26 | #include "printf.h" |
| 22 | 27 | |
| 23 | 28 | /* |
| 24 | 29 | ** Conversion types fall into various categories as defined by the |
| 25 | 30 |
| --- src/printf.c | |
| +++ src/printf.c | |
| @@ -15,10 +15,15 @@ | |
| 15 | ** |
| 16 | ******************************************************************************* |
| 17 | ** |
| 18 | ** An implementation of printf() with extra conversion fields. |
| 19 | */ |
| 20 | #include "config.h" |
| 21 | #include "printf.h" |
| 22 | |
| 23 | /* |
| 24 | ** Conversion types fall into various categories as defined by the |
| 25 |
| --- src/printf.c | |
| +++ src/printf.c | |
| @@ -15,10 +15,15 @@ | |
| 15 | ** |
| 16 | ******************************************************************************* |
| 17 | ** |
| 18 | ** An implementation of printf() with extra conversion fields. |
| 19 | */ |
| 20 | |
| 21 | /* prevent "fossil_strcmp" to be optimized using the assumption |
| 22 | * that its arguments cannot be NULL */ |
| 23 | #undef fossil_strcmp |
| 24 | |
| 25 | #include "config.h" |
| 26 | #include "printf.h" |
| 27 | |
| 28 | /* |
| 29 | ** Conversion types fall into various categories as defined by the |
| 30 |
+5
| --- src/printf.c | ||
| +++ src/printf.c | ||
| @@ -15,10 +15,15 @@ | ||
| 15 | 15 | ** |
| 16 | 16 | ******************************************************************************* |
| 17 | 17 | ** |
| 18 | 18 | ** An implementation of printf() with extra conversion fields. |
| 19 | 19 | */ |
| 20 | + | |
| 21 | +/* prevent "fossil_strcmp" to be optimized using the assumption | |
| 22 | + * that its arguments cannot be NULL */ | |
| 23 | +#undef fossil_strcmp | |
| 24 | + | |
| 20 | 25 | #include "config.h" |
| 21 | 26 | #include "printf.h" |
| 22 | 27 | |
| 23 | 28 | /* |
| 24 | 29 | ** Conversion types fall into various categories as defined by the |
| 25 | 30 |
| --- src/printf.c | |
| +++ src/printf.c | |
| @@ -15,10 +15,15 @@ | |
| 15 | ** |
| 16 | ******************************************************************************* |
| 17 | ** |
| 18 | ** An implementation of printf() with extra conversion fields. |
| 19 | */ |
| 20 | #include "config.h" |
| 21 | #include "printf.h" |
| 22 | |
| 23 | /* |
| 24 | ** Conversion types fall into various categories as defined by the |
| 25 |
| --- src/printf.c | |
| +++ src/printf.c | |
| @@ -15,10 +15,15 @@ | |
| 15 | ** |
| 16 | ******************************************************************************* |
| 17 | ** |
| 18 | ** An implementation of printf() with extra conversion fields. |
| 19 | */ |
| 20 | |
| 21 | /* prevent "fossil_strcmp" to be optimized using the assumption |
| 22 | * that its arguments cannot be NULL */ |
| 23 | #undef fossil_strcmp |
| 24 | |
| 25 | #include "config.h" |
| 26 | #include "printf.h" |
| 27 | |
| 28 | /* |
| 29 | ** Conversion types fall into various categories as defined by the |
| 30 |