From 49c96df121c254ddedf001b986e1592107c739cd Mon Sep 17 00:00:00 2001 From: William Robinet Date: Sat, 29 Aug 2020 12:07:39 +0200 Subject: [PATCH 01/14] Add Clang CI --- .github/workflows/clang.yml | 24 ++++++++++++++++++++++++ .github/workflows/{ccpp.yml => gcc.yml} | 2 +- 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/clang.yml rename .github/workflows/{ccpp.yml => gcc.yml} (96%) diff --git a/.github/workflows/clang.yml b/.github/workflows/clang.yml new file mode 100644 index 0000000..17df8d0 --- /dev/null +++ b/.github/workflows/clang.yml @@ -0,0 +1,24 @@ +name: Clang CI + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Install dependencies + run: | + sudo apt install clang autoconf libpcap-dev libssl-dev + - name: autogen + run: ./autogen.sh + - name: configure + run: CC=/usr/bin/clang ./configure + - name: make + run: make diff --git a/.github/workflows/ccpp.yml b/.github/workflows/gcc.yml similarity index 96% rename from .github/workflows/ccpp.yml rename to .github/workflows/gcc.yml index eca5575..a3459ed 100644 --- a/.github/workflows/ccpp.yml +++ b/.github/workflows/gcc.yml @@ -1,4 +1,4 @@ -name: C/C++ CI +name: GCC CI on: push: From ce378dc7dc601101ca8b02eeebe3163382729a60 Mon Sep 17 00:00:00 2001 From: William Robinet Date: Sat, 29 Aug 2020 12:17:01 +0200 Subject: [PATCH 02/14] Force use of GCC in GCC CI --- .github/workflows/gcc.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/gcc.yml b/.github/workflows/gcc.yml index a3459ed..ef18971 100644 --- a/.github/workflows/gcc.yml +++ b/.github/workflows/gcc.yml @@ -19,6 +19,6 @@ jobs: - name: autogen run: ./autogen.sh - name: configure - run: ./configure + run: CC=/usr/bin/gcc ./configure - name: make run: make From b61c42063682ab26088a3808fe86a303504f5a35 Mon Sep 17 00:00:00 2001 From: William Robinet Date: Sat, 29 Aug 2020 20:57:42 +0200 Subject: [PATCH 03/14] Prepare ASAN build --- configure.ac | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/configure.ac b/configure.ac index 45e20fc..9746327 100644 --- a/configure.ac +++ b/configure.ac @@ -15,8 +15,6 @@ AC_PROG_INSTALL # Checks for header files. -AC_FUNC_ALLOCA -AC_FUNC_MALLOC AC_CHECK_HEADERS([arpa/inet.h memory.h netdb.h netinet/in.h stdlib.h string.h sys/param.h sys/socket.h sys/time.h unistd.h],,[AC_MSG_ERROR([Missing header.])]) AC_HEADER_STDC AC_HEADER_TIME @@ -74,9 +72,7 @@ AC_CHECK_SIZEOF([unsigned long]) AC_CHECK_SIZEOF([unsigned long long]) # Checks for library functions. -AC_FUNC_MALLOC -AC_FUNC_REALLOC -AC_CHECK_FUNCS([gethostbyaddr gettimeofday inet_ntoa isascii memmove memset strchr strdup strstr strtol]) +AC_CHECK_FUNCS([malloc realloc gethostbyaddr gettimeofday inet_ntoa isascii memmove memset strchr strdup strstr strtol]) AC_CONFIG_FILES([Makefile common/Makefile From bcf3dddbf06dec8e6a34486c693df471959018ce Mon Sep 17 00:00:00 2001 From: William Robinet Date: Sun, 30 Aug 2020 07:37:45 +0200 Subject: [PATCH 04/14] Reorder checks in configure.ac --- configure.ac | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/configure.ac b/configure.ac index 9746327..46c2d0d 100644 --- a/configure.ac +++ b/configure.ac @@ -13,12 +13,20 @@ AM_PROG_CC_C_O AC_PROG_MAKE_SET AC_PROG_INSTALL - # Checks for header files. AC_CHECK_HEADERS([arpa/inet.h memory.h netdb.h netinet/in.h stdlib.h string.h sys/param.h sys/socket.h sys/time.h unistd.h],,[AC_MSG_ERROR([Missing header.])]) AC_HEADER_STDC AC_HEADER_TIME +# Checks for typedefs, structures, and compiler characteristics. +AC_CHECK_SIZEOF([unsigned short]) +AC_CHECK_SIZEOF([unsigned int]) +AC_CHECK_SIZEOF([unsigned long]) +AC_CHECK_SIZEOF([unsigned long long]) + +# Checks for library functions. +AC_CHECK_FUNCS([malloc realloc gethostbyaddr gettimeofday inet_ntoa isascii memmove memset strchr strdup strstr strtol]) + have_pcap=no AC_SEARCH_LIBS([pcap_create], [pcap], [have_pcap=yes]) @@ -65,15 +73,6 @@ fi AC_CHECK_LIB([ssl], [OPENSSL_init_ssl]) -# Checks for typedefs, structures, and compiler characteristics. -AC_CHECK_SIZEOF([unsigned short]) -AC_CHECK_SIZEOF([unsigned int]) -AC_CHECK_SIZEOF([unsigned long]) -AC_CHECK_SIZEOF([unsigned long long]) - -# Checks for library functions. -AC_CHECK_FUNCS([malloc realloc gethostbyaddr gettimeofday inet_ntoa isascii memmove memset strchr strdup strstr strtol]) - AC_CONFIG_FILES([Makefile common/Makefile common/lib/Makefile From 7d78d10423f360b1987b9a2b40377e944f4e2827 Mon Sep 17 00:00:00 2001 From: William Robinet Date: Sun, 30 Aug 2020 08:05:24 +0200 Subject: [PATCH 05/14] Remove deprecated define --- Makefile.am | 1 - 1 file changed, 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index 6271315..0191b06 100644 --- a/Makefile.am +++ b/Makefile.am @@ -23,7 +23,6 @@ ssldump_CPPFLAGS = \ -I$(top_srcdir)/null\ -I$(top_srcdir)/ssl\ -I$(top_srcdir)/base\ - -D_BSD_SOURCE=1\ -D_DEFAULT_SOURCE=1\ -DLINUX From 55ca4e1b14f88d0cb3a28834636dd702d675afcf Mon Sep 17 00:00:00 2001 From: William Robinet Date: Sun, 30 Aug 2020 08:06:34 +0200 Subject: [PATCH 06/14] Remove -g from default CFLAGS and check for Clang explicitly --- configure.ac | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 46c2d0d..f5ead2d 100644 --- a/configure.ac +++ b/configure.ac @@ -8,7 +8,8 @@ AC_CONFIG_SRCDIR([base/pcap-snoop.c]) AC_CONFIG_HEADERS([config.h]) # Checks for programs. -AC_PROG_CC +: ${CFLAGS="-O2"} +AC_PROG_CC([gcc clang]) AM_PROG_CC_C_O AC_PROG_MAKE_SET AC_PROG_INSTALL From 4f02d24aebb9fef158e1b69562d3b8db78137072 Mon Sep 17 00:00:00 2001 From: William Robinet Date: Sun, 30 Aug 2020 19:06:47 +0200 Subject: [PATCH 07/14] Update .gitignore, rearrange CI workflows variable definition --- .github/workflows/clang.yml | 2 +- .github/workflows/gcc.yml | 2 +- .gitignore | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/clang.yml b/.github/workflows/clang.yml index 17df8d0..9ebe978 100644 --- a/.github/workflows/clang.yml +++ b/.github/workflows/clang.yml @@ -19,6 +19,6 @@ jobs: - name: autogen run: ./autogen.sh - name: configure - run: CC=/usr/bin/clang ./configure + run: ./configure CC=/usr/bin/clang - name: make run: make diff --git a/.github/workflows/gcc.yml b/.github/workflows/gcc.yml index ef18971..44a6f3a 100644 --- a/.github/workflows/gcc.yml +++ b/.github/workflows/gcc.yml @@ -19,6 +19,6 @@ jobs: - name: autogen run: ./autogen.sh - name: configure - run: CC=/usr/bin/gcc ./configure + run: ./configure CC=/usr/bin/gcc - name: make run: make diff --git a/.gitignore b/.gitignore index f3a297a..1f30374 100644 --- a/.gitignore +++ b/.gitignore @@ -19,6 +19,8 @@ common/lib/Makefile.in compile config.h config.h.in +config.guess +config.sub configure depcomp install-sh From d50dbc689f8cafc7e0e58b6d595eae2c52bc86d6 Mon Sep 17 00:00:00 2001 From: William Robinet Date: Sun, 30 Aug 2020 19:08:43 +0200 Subject: [PATCH 08/14] Reenable OpenSSL code compilation --- Makefile.am | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Makefile.am b/Makefile.am index 0191b06..05aea85 100644 --- a/Makefile.am +++ b/Makefile.am @@ -8,6 +8,8 @@ ssldump_SOURCES = \ base/common.c\ ssl/ssl_analyze.c\ null/null_analyze.c\ + common/lib/r_data.c\ + common/lib/r_assoc.c\ common/lib/r_errors.c\ base/tcppack.c\ base/tcpconn.c\ @@ -15,7 +17,8 @@ ssldump_SOURCES = \ ssl/sslprint.c\ ssl/ssl.enums.c\ ssl/sslxprint.c\ - ssl/ciphersuites.c + ssl/ciphersuites.c\ + ssl/ssl_rec.c ssldump_CPPFLAGS = \ -I$(top_srcdir)\ @@ -24,5 +27,5 @@ ssldump_CPPFLAGS = \ -I$(top_srcdir)/ssl\ -I$(top_srcdir)/base\ -D_DEFAULT_SOURCE=1\ - -DLINUX - + -DLINUX\ + -DOPENSSL From 30b7840ce1e26f5a1ed130227f7c254ea348a249 Mon Sep 17 00:00:00 2001 From: William Robinet Date: Sun, 30 Aug 2020 19:09:42 +0200 Subject: [PATCH 09/14] Add optional features to ./configure (ASAN, debug, optimization) --- configure.ac | 64 ++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 60 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index f5ead2d..3ac3f12 100644 --- a/configure.ac +++ b/configure.ac @@ -7,8 +7,10 @@ AM_INIT_AUTOMAKE([subdir-objects]) AC_CONFIG_SRCDIR([base/pcap-snoop.c]) AC_CONFIG_HEADERS([config.h]) +AC_CANONICAL_HOST + # Checks for programs. -: ${CFLAGS="-O2"} +: ${CFLAGS=""} AC_PROG_CC([gcc clang]) AM_PROG_CC_C_O AC_PROG_MAKE_SET @@ -49,10 +51,9 @@ files with ]) fi -AC_CHECK_LIB([pcap],[pcap_create]) - have_ssl=no AC_SEARCH_LIBS([OPENSSL_init_ssl], [ssl], [have_ssl=yes]) +AC_SEARCH_LIBS(CRYPTO_new_ex_data, [crypto], [have_crypto=yes]) if test "x${have_ssl}" = xyes; then AC_CHECK_HEADERS([openssl/ssl.h], [], [have_ssl=no]) @@ -72,7 +73,45 @@ files with ]) fi -AC_CHECK_LIB([ssl], [OPENSSL_init_ssl]) +AC_ARG_ENABLE([optimization], + [ --disable-optimization disable compiler optimizations], + [optimization=${enableval}], [optimization=yes]) + +if test "x${optimization}" = xno; then + CFLAGS="$CFLAGS -O0" +else + CFLAGS="$CFLAGS -O2" +fi + +AC_ARG_ENABLE([debug], + [ --enable-debug enable debug info], + [debug=${enableval}], [debug=no]) + +if test "x${debug}" = xyes; then + CFLAGS="$CFLAGS -g" +fi + +AC_ARG_ENABLE([asan], + [ --enable-asan enable AddressSanitizer and other checks], + [asan=${enableval}], [asan=no]) + +if test "x${asan}" = xyes; then + AS_CASE([$CC], + [*gcc*], [AC_CHECK_LIB(asan, _init)], + [*clang*], [have_clang=yes], + [have_clang=no]) + + if (test "x${ac_cv_lib_asan__init}" = xyes || test "x$have_clang" = xyes); then + CFLAGS="$CFLAGS \ +-fsanitize=address,undefined,leak \ +-Wformat \ +-Werror=format-security \ +-Werror=array-bounds" + else + AC_MSG_WARN("AddressSanitizer not supported") + asan=no + fi +fi AC_CONFIG_FILES([Makefile common/Makefile @@ -80,4 +119,21 @@ AC_CONFIG_FILES([Makefile null/Makefile ssl/Makefile base/Makefile]) + AC_OUTPUT + +echo +echo "################################################" +echo "SSLDump build setup" +echo " Host system: $host_os" +echo " Host architecture: $host_cpu" +echo " Compiler: $CC" +echo " Installation prefix: $prefix" +echo " CFLAGS: $CFLAGS" +echo " LDFLAGS: $LDFLAGS" +echo " LIBS: $LIBS" +echo " Optimizations enabled: $optimization" +echo " Debug info enabled: $debug" +echo " ASAN enabled: $asan" +echo "################################################" + From dd5593e5b818c92625abac1f5d61a053ff33f41e Mon Sep 17 00:00:00 2001 From: William Robinet Date: Sun, 30 Aug 2020 20:59:48 +0200 Subject: [PATCH 10/14] Define DEBUG when using --enable-debug --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 3ac3f12..b1625a1 100644 --- a/configure.ac +++ b/configure.ac @@ -88,7 +88,7 @@ AC_ARG_ENABLE([debug], [debug=${enableval}], [debug=no]) if test "x${debug}" = xyes; then - CFLAGS="$CFLAGS -g" + CFLAGS="$CFLAGS -g -DDEBUG" fi AC_ARG_ENABLE([asan], From eeb45211fe04f3ba3e6b4785a53f4517853dbe5d Mon Sep 17 00:00:00 2001 From: William Robinet Date: Fri, 4 Sep 2020 14:13:59 +0200 Subject: [PATCH 11/14] Clean debug functions, remove duplicates --- Makefile.am | 3 ++- base/common.c | 66 ------------------------------------------------- base/debug.c | 68 --------------------------------------------------- base/debug.h | 58 ------------------------------------------- 4 files changed, 2 insertions(+), 193 deletions(-) delete mode 100644 base/common.c delete mode 100644 base/debug.c delete mode 100644 base/debug.h diff --git a/Makefile.am b/Makefile.am index 05aea85..df72dfa 100644 --- a/Makefile.am +++ b/Makefile.am @@ -5,12 +5,12 @@ ssldump_SOURCES = \ base/pcap-snoop.c\ base/network.c\ base/proto_mod.c\ - base/common.c\ ssl/ssl_analyze.c\ null/null_analyze.c\ common/lib/r_data.c\ common/lib/r_assoc.c\ common/lib/r_errors.c\ + common/lib/debug.c\ base/tcppack.c\ base/tcpconn.c\ ssl/ssldecode.c\ @@ -23,6 +23,7 @@ ssldump_SOURCES = \ ssldump_CPPFLAGS = \ -I$(top_srcdir)\ -I$(top_srcdir)/common/include\ + -I$(top_srcdir)/common/lib\ -I$(top_srcdir)/null\ -I$(top_srcdir)/ssl\ -I$(top_srcdir)/base\ diff --git a/base/common.c b/base/common.c deleted file mode 100644 index 2f29bf0..0000000 --- a/base/common.c +++ /dev/null @@ -1,66 +0,0 @@ -/** - common.c - - - Copyright (C) 1999-2000 RTFM, Inc. - All Rights Reserved - - This package is a SSLv3/TLS protocol analyzer written by Eric Rescorla - and licensed by RTFM, Inc. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - 3. All advertising materials mentioning features or use of this software - must display the following acknowledgement: - - This product includes software developed by Eric Rescorla for - RTFM, Inc. - - 4. Neither the name of RTFM, Inc. nor the name of Eric Rescorla may be - used to endorse or promote products derived from this - software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY ERIC RESCORLA AND RTFM, INC. ``AS IS'' AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY SUCH DAMAGE. - - $Id: common.c,v 1.2 2000/10/17 16:09:57 ekr Exp $ - - - ekr@rtfm.com Tue Dec 29 09:59:39 1998 - */ - - -static char *RCSSTRING="$Id: common.c,v 1.2 2000/10/17 16:09:57 ekr Exp $"; - -#include - -int xdump(label,data,len) - char *label; - UCHAR *data; - int len; - { - int i; - - printf("%s[%d]",label,len); - for(i=0;i8) && !(i%20)) printf("\n"); - printf("%.2x ",data[i]&255); - } - - printf("\n"); - return(0); - } diff --git a/base/debug.c b/base/debug.c deleted file mode 100644 index a0ff54b..0000000 --- a/base/debug.c +++ /dev/null @@ -1,68 +0,0 @@ -/** - debug.c - - - Copyright (C) 1999-2000 RTFM, Inc. - All Rights Reserved - - This package is a SSLv3/TLS protocol analyzer written by Eric Rescorla - and licensed by RTFM, Inc. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - 3. All advertising materials mentioning features or use of this software - must display the following acknowledgement: - - This product includes software developed by Eric Rescorla for - RTFM, Inc. - - 4. Neither the name of RTFM, Inc. nor the name of Eric Rescorla may be - used to endorse or promote products derived from this - software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY ERIC RESCORLA AND RTFM, INC. ``AS IS'' AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY SUCH DAMAGE. - - $Id: debug.c,v 1.2 2000/10/17 16:09:57 ekr Exp $ - - - ekr@rtfm.com Wed Jan 6 17:08:58 1999 - */ - - -static char *RCSSTRING="$Id: debug.c,v 1.2 2000/10/17 16:09:57 ekr Exp $"; - -#ifdef DEBUG - -#include -#include - -int debug(int class,char *format,...) - { - va_list ap; - - va_start(ap,format); - vfprintf(stderr,format,ap); - fprintf(stderr,"\n"); - return(0); - } - -#endif - - - - diff --git a/base/debug.h b/base/debug.h deleted file mode 100644 index b5d45de..0000000 --- a/base/debug.h +++ /dev/null @@ -1,58 +0,0 @@ -/** - debug.h - - - Copyright (C) 1999-2000 RTFM, Inc. - All Rights Reserved - - This package is a SSLv3/TLS protocol analyzer written by Eric Rescorla - and licensed by RTFM, Inc. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - 3. All advertising materials mentioning features or use of this software - must display the following acknowledgement: - - This product includes software developed by Eric Rescorla for - RTFM, Inc. - - 4. Neither the name of RTFM, Inc. nor the name of Eric Rescorla may be - used to endorse or promote products derived from this - software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY ERIC RESCORLA AND RTFM, INC. ``AS IS'' AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY SUCH DAMAGE. - - $Id: debug.h,v 1.2 2000/10/17 16:09:57 ekr Exp $ - - - ekr@rtfm.com Wed Jan 6 17:13:00 1999 - */ - - -#ifndef _debug_h -#define _debug_h - -#ifdef DEBUG -#define DBG(a) debug a -int debug(int class,char *format,...); -#else -#define DBG(a) -#endif - -#endif - From 3518115da992988adba23b5546340f444714a00f Mon Sep 17 00:00:00 2001 From: William Robinet Date: Sun, 30 Aug 2020 21:11:52 +0200 Subject: [PATCH 12/14] Update README.md with ./configure options --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index 5496b95..fbfb87b 100644 --- a/README.md +++ b/README.md @@ -50,6 +50,15 @@ make (optional) make install ``` +Optional configuration features (aka ./configure options): +``` + --disable-optimization disable compiler optimizations (change from -O2 to -O0) + --enable-debug enable debug info (add "-g -DDEBUG" to CFLAGS) + --enable-asan enable AddressSanitizer and other checks + add "-fsanitize=address,undefined,leak -Wformat -Werror=format-security -Werror=array-bounds" to CFLAGS + use libasan with GCC and embedded ASAN with Clang +``` + ## Contributing The contributing policy is simple. If you have a patch to propose, make a pull-request From 901fa19b2c8b5a2f617e888f11c2347378758d3d Mon Sep 17 00:00:00 2001 From: William Robinet Date: Sun, 30 Aug 2020 21:19:28 +0200 Subject: [PATCH 13/14] Update README.md with ./configure examples --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index fbfb87b..7688fa6 100644 --- a/README.md +++ b/README.md @@ -59,6 +59,15 @@ Optional configuration features (aka ./configure options): use libasan with GCC and embedded ASAN with Clang ``` +Configuration examples: +``` +- Use GCC with libasan, debug info and custom CFLAGS: + ./configure CC=/usr/bin/gcc --enable-asan --enable-debug CFLAGS="-Wall" + +- Use Clang with ASAN and no optimizations (-O0) + ./configure CC=/usr/bin/clang --enable-asan --disable-optimization +``` + ## Contributing The contributing policy is simple. If you have a patch to propose, make a pull-request From 2da2a5a3dc8695c9d676a844113cab9363f746cd Mon Sep 17 00:00:00 2001 From: William Robinet Date: Mon, 31 Aug 2020 07:56:05 +0200 Subject: [PATCH 14/14] Fix long line in README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 7688fa6..901ab52 100644 --- a/README.md +++ b/README.md @@ -55,7 +55,8 @@ Optional configuration features (aka ./configure options): --disable-optimization disable compiler optimizations (change from -O2 to -O0) --enable-debug enable debug info (add "-g -DDEBUG" to CFLAGS) --enable-asan enable AddressSanitizer and other checks - add "-fsanitize=address,undefined,leak -Wformat -Werror=format-security -Werror=array-bounds" to CFLAGS + add "-fsanitize=address,undefined,leak -Wformat -Werror=format-security + -Werror=array-bounds" to CFLAGS use libasan with GCC and embedded ASAN with Clang ```