Skip to content

Commit

Permalink
flambda-backend: Cpp mangling is now a configuration option (ocaml#614)
Browse files Browse the repository at this point in the history
  • Loading branch information
poechsel committed Apr 15, 2022
1 parent 20fc614 commit d234bfd
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 0 deletions.
1 change: 1 addition & 0 deletions Makefile.config.in
Expand Up @@ -225,6 +225,7 @@ WITH_OCAMLDOC=@ocamldoc@
WITH_OCAMLTEST=@ocamltest@
ASM_CFI_SUPPORTED=@asm_cfi_supported@
WITH_FRAME_POINTERS=@frame_pointers@
WITH_CPP_MANGLING=@cpp_mangling@
WITH_PROFINFO=@profinfo@
PROFINFO_WIDTH=@profinfo_width@
WITH_FPIC=@fpic@
Expand Down
20 changes: 20 additions & 0 deletions configure

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions configure.ac
Expand Up @@ -152,6 +152,7 @@ AC_SUBST([install_source_artifacts])
AC_SUBST([profinfo])
AC_SUBST([profinfo_width])
AC_SUBST([frame_pointers])
AC_SUBST([cpp_mangling])
AC_SUBST([flambda])
AC_SUBST([flambda2])
AC_SUBST([flambda_invariants])
Expand Down Expand Up @@ -278,6 +279,10 @@ AC_ARG_ENABLE([frame-pointers],
[AS_HELP_STRING([--enable-frame-pointers],
[use frame pointers in runtime and generated code])])

AC_ARG_ENABLE([cpp-mangling],
[AS_HELP_STRING([--enable-cpp-mangling],
[use cpp mangling for exported symbols])])

AC_ARG_ENABLE([naked-pointers],
[AS_HELP_STRING([--disable-naked-pointers],
[do not allow naked pointers])])
Expand Down Expand Up @@ -1738,6 +1743,13 @@ AS_IF([test x"$enable_frame_pointers" = "xyes"],
[AC_MSG_NOTICE([not using frame pointers])
frame_pointers=false])

## CPP mangling

AS_IF([test x"$enable_cpp_mangling" = "xyes"],
[cpp_mangling=true
AC_DEFINE([WITH_CPP_MANGLING])],
[cpp_mangling=false])

## No naked pointers

AS_IF([test x"$enable_naked_pointers" = "xno" ],
Expand Down
1 change: 1 addition & 0 deletions utils/Makefile
Expand Up @@ -86,6 +86,7 @@ config.ml: config.mlp $(ROOTDIR)/Makefile.config Makefile
$(call SUBST,SYSTHREAD_SUPPORT) \
$(call SUBST,TARGET) \
$(call SUBST,WITH_FRAME_POINTERS) \
$(call SUBST,WITH_CPP_MANGLING) \
$(call SUBST,WITH_PROFINFO) \
$(call SUBST,FLAT_FLOAT_ARRAY) \
$(call SUBST,FUNCTION_SECTIONS) \
Expand Down
3 changes: 3 additions & 0 deletions utils/config.mli
Expand Up @@ -164,6 +164,9 @@ val asm_cfi_supported: bool
val with_frame_pointers : bool
(** Whether assembler should maintain frame pointers *)

val with_cpp_mangling : bool
(** Whether symbol names should be following the cpp mangling convention *)

val ext_obj: string
(** Extension for object files, e.g. [.o] under Unix. *)

Expand Down
2 changes: 2 additions & 0 deletions utils/config.mlp
Expand Up @@ -135,6 +135,7 @@ let system = "%%SYSTEM%%"
let asm = "%%ASM%%"
let asm_cfi_supported = %%ASM_CFI_SUPPORTED%%
let with_frame_pointers = %%WITH_FRAME_POINTERS%%
let with_cpp_mangling = %%WITH_CPP_MANGLING%%
let profinfo = %%WITH_PROFINFO%%
let profinfo_width = %%PROFINFO_WIDTH%%

Expand Down Expand Up @@ -190,6 +191,7 @@ let configuration_variables =
p "asm" asm;
p_bool "asm_cfi_supported" asm_cfi_supported;
p_bool "with_frame_pointers" with_frame_pointers;
p_bool "with_cpp_mangling" with_cpp_mangling;
p "ext_exe" ext_exe;
p "ext_obj" ext_obj;
p "ext_asm" ext_asm;
Expand Down

0 comments on commit d234bfd

Please sign in to comment.