diff mbox series

[2/3] build-sys: check static linking of UBSAN

Message ID 20180208162343.30809-2-marcandre.lureau@redhat.com
State New
Headers show
Series [1/3] build-sys: remove useless extra*flags variables | expand

Commit Message

Marc-André Lureau Feb. 8, 2018, 4:23 p.m. UTC
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 configure | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

Comments

Eric Blake Feb. 8, 2018, 5:48 p.m. UTC | #1
On 02/08/2018 10:23 AM, Marc-André Lureau wrote:
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
>   configure | 10 +++++++++-
>   1 file changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/configure b/configure
> index 41d8a2666c..beb0de6a77 100755
> --- a/configure
> +++ b/configure
> @@ -5247,7 +5247,15 @@ fi
>   ##########################################
>   # checks for sanitizers
>   
> -write_c_skeleton
> +# we could use a simple skeleton for flags chekcs, but this also

s/chekcs/checks/

> +# detect the static linking issue of ubsan, see also:
> +# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84285
> +cat > $TMPC << EOF
> +#include <stdint.h>
> +int main(void) {
> +  return INT32_MIN / -1;
> +}
> +EOF
>   
>   have_asan=no
>   have_ubsan=no
>
diff mbox series

Patch

diff --git a/configure b/configure
index 41d8a2666c..beb0de6a77 100755
--- a/configure
+++ b/configure
@@ -5247,7 +5247,15 @@  fi
 ##########################################
 # checks for sanitizers
 
-write_c_skeleton
+# we could use a simple skeleton for flags chekcs, but this also
+# detect the static linking issue of ubsan, see also:
+# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84285
+cat > $TMPC << EOF
+#include <stdint.h>
+int main(void) {
+  return INT32_MIN / -1;
+}
+EOF
 
 have_asan=no
 have_ubsan=no