0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-26 07:23:53 +01:00

configure: Eliminate clang runtime profiling infrastructure.

This commit is contained in:
Jason Volk 2023-01-14 15:58:28 -08:00
parent d5c0e60633
commit f516b86e4d
4 changed files with 0 additions and 132 deletions

View file

@ -393,73 +393,6 @@ AC_ARG_WITH(log-level, RB_HELP_STRING([--with-log-level[[[=INFO]]]], [Explicitly
])
])
dnl
dnl Profiling mode
dnl
AC_MSG_CHECKING(whether to instrument build for runtime profile generation)
AC_ARG_ENABLE(profile, RB_HELP_STRING([--enable-profile], [Generate profile at runtime]),
[
profiling="yes"
AC_DEFINE(CHARYBDIS_PROFILE, 1, [Define this if you are profiling.])
AM_COND_IF(GCC,
[
AC_MSG_RESULT([yes, adding -pg])
RB_VAR_PREPEND([CXXFLAGS], ["-pg"])
])
AM_COND_IF(CLANG,
[
AC_MSG_RESULT([yes, adding profiling flags])
#RB_VAR_PREPEND([CXXFLAGS], ["-fprofile-generate"])
#RB_VAR_PREPEND([LDFLAGS], ["-Wl,-fprofile-generate"])
dnl TODO: $enableval=instr?
dnl RB_VAR_PREPEND([CXXFLAGS], ["-fprofile-instr-generate"])
dnl RB_VAR_PREPEND([CXXFLAGS], ["-fcoverage-mapping"])
dnl RB_VAR_PREPEND([LDFLAGS], ["-Wl,-fprofile-instr-generate"])
])
], [
AC_MSG_RESULT([no])
profiling="no"
])
AM_CONDITIONAL([PROFILE], [[[[ "$profiling" = "yes" ]]]])
AC_MSG_CHECKING(whether to use a specific runtime profile)
AC_ARG_WITH(profile, RB_HELP_STRING([--with-profile[[[=$PWD]]]], [Path to profdata]),
[
profile_use=$withval
AC_MSG_RESULT([yes, "$profile_use"])
AC_SUBST(PROFILE_USE, $profile_use)
], [
AM_COND_IF([CLANG],
[
profile_use="yes"
AC_MSG_RESULT([yes, if default.profdata is found])
], [
profile_use="no"
AC_MSG_RESULT([no])
])
])
AM_CONDITIONAL([PROFILE_USE], [[[[ "$profile_use" != "no" ]] && [[ "$profiling" == "no" ]]]])
AM_COND_IF([PROFILE_USE],
[
dnl Provide the correct target to the Makefiles
AC_PATH_PROG(LLVM_PROFDATA, llvm-profdata)
AM_COND_IF(CLANG14, [ AC_PATH_PROG(LLVM_PROFDATA, llvm-profdata-14) ])
AM_COND_IF(CLANG13, [ AC_PATH_PROG(LLVM_PROFDATA, llvm-profdata-13) ])
AM_COND_IF(CLANG12, [ AC_PATH_PROG(LLVM_PROFDATA, llvm-profdata-12) ])
AM_COND_IF(CLANG11, [ AC_PATH_PROG(LLVM_PROFDATA, llvm-profdata-11) ])
AM_COND_IF(CLANG10, [ AC_PATH_PROG(LLVM_PROFDATA, llvm-profdata-10) ])
AM_COND_IF(CLANG9, [ AC_PATH_PROG(LLVM_PROFDATA, llvm-profdata-9) ])
])
dnl
dnl Precompiled headers
dnl
@ -3235,8 +3168,6 @@ echo "Developer debugging ............... $debug"
echo "Developer assertions .............. $assert ($assert_type)"
echo "Optimized compile ................. $optimize (-O$optimize_level)"
echo "Optimized linking ................. $lto"
echo "Optimized runtime ................. $profile_use"
echo "Profiling runtime ................. $profiling"
echo
echo "Magic support ..................... $have_magic"
echo "ImageMagick support ............... $have_imagemagick"

View file

@ -38,12 +38,6 @@ AM_LDFLAGS = \
$(EXTRA_LDFLAGS) \
###
if PROFILE
if CLANG
AM_CXXFLAGS += -fprofile-generate
endif
endif
bin_PROGRAMS = construct
construct_LDFLAGS = \

View file

@ -57,26 +57,6 @@ AM_CXXFLAGS += -fwhole-program-vtables
endif
endif
if CLANG
if PROFILE_USE
AM_CXXFLAGS += -fprofile-use
BUILT_SOURCES += default.profdata
CLEANFILES += default.profdata
endif
endif
if CLANG
if PROFILE
AM_CXXFLAGS += -fprofile-generate
AM_LDFLAGS += -Wl,-fprofile-generate
#TODO: XXX
#AM_CXXFLAGS += -fprofile-instr-generate
#AM_CXXFLAGS += -fcoverage-mapping
#AM_LDFLAGS += -Wl,-fprofile-instr-generate
#AM_LDFLAGS += -Wl,-fcoverage-mapping
endif
endif
if GOLD
AM_LDFLAGS += -Wl,--no-text-reorder
AM_LDFLAGS += -Wl,--weak-unresolved-symbols
@ -136,13 +116,6 @@ libircd_la_LIBADD += @Z_LIBS@
libircd_la_LIBADD += @URING_LIBS@
libircd_la_LIBADD += $(EXTRA_LIBS)
if PROFILE
if CLANG11
#TODO: XXX
libircd_la_LIBADD += /usr/lib/llvm-11/lib/clang/11.0.0/lib/linux/libclang_rt.profile-x86_64.a
endif
endif
#
# Unit list
#
@ -154,7 +127,6 @@ endif
#
libircd_la_SOURCES =#
libircd_la_SOURCES += default.profdata
libircd_la_SOURCES += assert.cc
libircd_la_SOURCES += vg.cc
libircd_la_SOURCES += exception.cc
@ -369,16 +341,6 @@ sodium.lo: AM_CPPFLAGS := @SODIUM_CPPFLAGS@ ${AM_CPPFLAGS}
tokens.lo: AM_CPPFLAGS := @BOOST_CPPFLAGS@ ${AM_CPPFLAGS}
endif
#
# Other recipes
#
# LLVM PGO text to binary for -fprofile-use
if CLANG
default.profdata:
-$(LLVM_PROFDATA) merge -output=default.profdata default.proftext
endif
###############################################################################
#
# Hardware Acceleration / sub-targets

View file

@ -48,14 +48,6 @@ AM_CXXFLAGS += -fwhole-program-vtables
endif
endif
if CLANG
if PROFILE_USE
AM_CXXFLAGS += -fprofile-use
BUILT_SOURCES += default.profdata
CLEANFILES += default.profdata
endif
endif
if GOLD
AM_LDFLAGS += -Wl,--no-gnu-unique
AM_LDFLAGS += -Wl,--no-text-reorder
@ -79,7 +71,6 @@ libircd_matrix_LTLIBRARIES += libircd_matrix.la
#
libircd_matrix_la_SOURCES =#
libircd_matrix_la_SOURCES += default.profdata
libircd_matrix_la_SOURCES += name.cc
libircd_matrix_la_SOURCES += id.cc
libircd_matrix_la_SOURCES += dbs.cc
@ -212,13 +203,3 @@ endif
id.lo: AM_CPPFLAGS := ${AM_CPPFLAGS} ${SPIRIT_UNIT_CPPFLAGS}
id.lo: CXXFLAGS += ${AM_CXXFLAGS} ${SPIRIT_UNIT_CXXFLAGS}
#
# Other recipes
#
# LLVM PGO text to binary for -fprofile-use
if CLANG
default.profdata:
-$(LLVM_PROFDATA) merge -output=default.profdata default.proftext
endif