Skip to content

Commit

Permalink
Fix --with-pic in configure (ocaml#8632)
Browse files Browse the repository at this point in the history
--with-pic should be adding -fPIC (or equivalent) to $internal_cflags,
not $common_cflags. Additionally, unused variable aspp was being
updated, instead of ASPP.
  • Loading branch information
dra27 authored and smuenzel committed Jun 26, 2019
1 parent 2519ac3 commit 043f8ea
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 21 deletions.
3 changes: 3 additions & 0 deletions Changes
Expand Up @@ -916,6 +916,9 @@ OCaml 4.08.0
(Sébastien Hinderer, review by David Allsopp, Gabriel Scherer and
Damien Doligez)

- #8632: Correctly propagate flags for --with-pic in configure.
(David Allsopp, review by Sébastien Hinderer and Damien Doligez)

- #8673: restore SpaceTime and libunwind support in configure script
(Sébastien Hinderer, review by Damien Doligez)

Expand Down
22 changes: 10 additions & 12 deletions configure
Expand Up @@ -13743,6 +13743,16 @@ esac ;; #(
;;
esac

if test "$with_pic"; then :
fpic=true
$as_echo "#define CAML_WITH_FPIC 1" >>confdefs.h

internal_cflags="$internal_cflags $sharedlib_cflags"
default_aspp="$default_aspp $sharedlib_cflags"
else
fpic=false
fi

if test -z "$AS"; then :
AS="$default_as"
fi
Expand Down Expand Up @@ -16469,18 +16479,6 @@ if $profinfo; then :

fi

## PIC

if test "$with_pic"; then :
fpic=true
$as_echo "#define CAML_WITH_FPIC 1" >>confdefs.h

common_cflags="$common_cflags $sharedlib_cflags"
aspp="$aspp $sharedlib_cflags"
else
fpic=false
fi

if test x"$enable_installing_bytecode_programs" = "xno"; then :
install_bytecode_programs=false
else
Expand Down
16 changes: 7 additions & 9 deletions configure.ac
Expand Up @@ -986,6 +986,13 @@ AS_CASE(["$arch,$system"],
[clang-*], [default_aspp="${toolpref}clang -c -Wno-trigraphs"],
[default_aspp="${toolpref}gcc -c"])])

AS_IF([test "$with_pic"],
[fpic=true
AC_DEFINE([CAML_WITH_FPIC])
internal_cflags="$internal_cflags $sharedlib_cflags"
default_aspp="$default_aspp $sharedlib_cflags"],
[fpic=false])

AS_IF([test -z "$AS"], [AS="$default_as"])

AS_IF([test -z "$ASPP"], [ASPP="$default_aspp"])
Expand Down Expand Up @@ -1579,15 +1586,6 @@ AS_IF([test x"$enable_spacetime" != "xyes" ],
AC_DEFINE_UNQUOTED([PROFINFO_WIDTH], [$profinfo_width])
AS_IF([$profinfo], [AC_DEFINE([WITH_PROFINFO])])

## PIC

AS_IF([test "$with_pic"],
[fpic=true
AC_DEFINE([CAML_WITH_FPIC])
common_cflags="$common_cflags $sharedlib_cflags"
aspp="$aspp $sharedlib_cflags"],
[fpic=false])

AS_IF([test x"$enable_installing_bytecode_programs" = "xno"],
[install_bytecode_programs=false],
[install_bytecode_programs=true])
Expand Down

0 comments on commit 043f8ea

Please sign in to comment.