Skip to content

Commit

Permalink
Revert "Improve handling of platforms that do not have gprof profilin…
Browse files Browse the repository at this point in the history
…g support (#933)"

This reverts commit 8adfe15.

This is a temporary revert caused by Continuous Integration
failure. We'll investigate the issue and merge again when it is fixed.
  • Loading branch information
gasche committed Nov 25, 2016
1 parent 0670dc2 commit 0657fd8
Show file tree
Hide file tree
Showing 14 changed files with 37 additions and 55 deletions.
6 changes: 0 additions & 6 deletions Changes
Expand Up @@ -35,12 +35,6 @@ Next version (4.05.0):
compiler when called to compile third-party C source files
(Sébastien Hinderer)

* GPR#933: ocamlopt -p now reports an error on platforms that do not
support profiling with gprof; dummy profiling libraries are no longer
installed on such platforms.
This can be tested with ocamlopt -config
(Sébastien Hinderer)

### Standard library:

- PR#6975, GPR#902: Truncate function added to stdlib Buffer module
Expand Down
1 change: 0 additions & 1 deletion Makefile
Expand Up @@ -442,7 +442,6 @@ utils/config.ml: utils/config.mlp config/Makefile
-e 's|%%HOST%%|$(HOST)|' \
-e 's|%%TARGET%%|$(TARGET)|' \
-e 's|%%FLAMBDA%%|$(FLAMBDA)|' \
-e 's|%%PROFILING%%|$(PROFILING)|' \
-e 's|%%SAFE_STRING%%|$(SAFE_STRING)|' \
utils/config.mlp > utils/config.ml

Expand Down
1 change: 0 additions & 1 deletion Makefile.nt
Expand Up @@ -406,7 +406,6 @@ utils/config.ml: utils/config.mlp config/Makefile
-e 's|%%CC_PROFILE%%||' \
-e 's|%%HOST%%|$(HOST)|' \
-e 's|%%TARGET%%|$(TARGET)|' \
-e 's|%%PROFILING%%|$(PROFILING)|' \
-e 's|%%FLAMBDA%%|$(FLAMBDA)|' \
-e 's|%%SAFE_STRING%%|$(SAFE_STRING)|' \
-e 's|%%FLEXLINK_FLAGS%%|$(FLEXLINK_FLAGS)|' \
Expand Down
15 changes: 7 additions & 8 deletions asmrun/Makefile
Expand Up @@ -36,13 +36,7 @@ IOBJS=$(COBJS:.o=.i.o) $(ASMOBJS)
POBJS=$(COBJS:.o=.p.o) $(ASMOBJS:.o=.p.o)
PICOBJS=$(COBJS:.o=.pic.o) $(ASMOBJS:.o=.pic.o)

ifeq "$(PROFILING)" "true"
PROFILINGTARGET = prof
else
PROFILINGTARGET = noprof
endif

all: libasmrun.a all-$(RUNTIMED) all-$(PROFILINGTARGET) all-$(SHARED)
all: libasmrun.a all-$(RUNTIMED) all-$(PROFILING) all-$(SHARED)

ifeq "$(RUNTIMEI)" "true"
all: libasmruni.a
Expand Down Expand Up @@ -109,9 +103,14 @@ install::
cd $(INSTALL_LIBDIR); $(RANLIB) libasmruni.a
endif

ifeq "$(PROFILING)" "true"
ifeq "$(PROFILING)" "prof"
install::
cp libasmrunp.a $(INSTALL_LIBDIR)/libasmrunp.a
cd $(INSTALL_LIBDIR); $(RANLIB) libasmrunp.a
else
install::
rm -f $(INSTALL_LIBDIR)/libasmrunp.a
ln -s libasmrun.a $(INSTALL_LIBDIR)/libasmrunp.a
endif

ifeq "$(SHARED)" "shared"
Expand Down
4 changes: 2 additions & 2 deletions config/Makefile-templ
Expand Up @@ -166,9 +166,9 @@ RANLIBCMD=ranlib

### Whether profiling with gprof is supported
# If yes: (e.g. x86/Linux, Sparc/Solaris):
#PROFILING=true
#PROFILING=prof
# If no:
#PROFILING=false
#PROFILING=noprof

### Option to give to the C compiler for profiling
#CC_PROFILE=-pg
Expand Down
2 changes: 1 addition & 1 deletion config/Makefile.mingw
Expand Up @@ -75,7 +75,7 @@ NATIVECCRPATH=
ASM=$(TOOLPREF)as
ASPP=$(TOOLPREF)gcc -c
ASPPPROFFLAGS=
PROFILING=false
PROFILING=noprof
DYNLINKOPTS=
CC_PROFILE=
SYSTHREAD_SUPPORT=true
Expand Down
2 changes: 1 addition & 1 deletion config/Makefile.mingw64
Expand Up @@ -75,7 +75,7 @@ NATIVECCRPATH=
ASM=$(TOOLPREF)as
ASPP=$(TOOLPREF)gcc -c
ASPPPROFFLAGS=
PROFILING=false
PROFILING=noprof
DYNLINKOPTS=
CC_PROFILE=
SYSTHREAD_SUPPORT=true
Expand Down
2 changes: 1 addition & 1 deletion config/Makefile.msvc
Expand Up @@ -69,7 +69,7 @@ NATIVECCRPATH=
ASM=ml -nologo -coff -Cp -c -Fo
ASPP=
ASPPPROFFLAGS=
PROFILING=false
PROFILING=noprof
DYNLINKOPTS=
CC_PROFILE=
SYSTHREAD_SUPPORT=true
Expand Down
2 changes: 1 addition & 1 deletion config/Makefile.msvc64
Expand Up @@ -69,7 +69,7 @@ NATIVECCRPATH=
ASM=ml64 -nologo -Cp -c -Fo
ASPP=
ASPPPROFFLAGS=
PROFILING=false
PROFILING=noprof
DYNLINKOPTS=
CC_PROFILE=
SYSTHREAD_SUPPORT=true
Expand Down
36 changes: 18 additions & 18 deletions configure
Expand Up @@ -1023,25 +1023,25 @@ if test -n "$asppoption"; then aspp="$asppoption"; fi

cc_profile='-pg'
case "$arch,$system" in
i386,linux_elf) profiling='true';;
i386,gnu) profiling='true';;
i386,bsd_elf) profiling='true';;
amd64,macosx) profiling='true';;
i386,macosx) profiling='true';;
sparc,bsd) profiling='true';;
i386,linux_elf) profiling='prof';;
i386,gnu) profiling='prof';;
i386,bsd_elf) profiling='prof';;
amd64,macosx) profiling='prof';;
i386,macosx) profiling='prof';;
sparc,bsd) profiling='prof';;
sparc,solaris)
profiling='true'
profiling='prof'
case "$nativecc" in gcc*) ;; *) cc_profile='-xpg';; esac;;
amd64,linux) profiling='true';;
amd64,openbsd) profiling='true';;
amd64,freebsd) profiling='true';;
amd64,netbsd) profiling='true';;
arm,netbsd) profiling='true';;
amd64,gnu) profiling='true';;
arm,linux*) profiling='true';;
power,elf) profiling='true';;
power,bsd*) profiling='true';;
*) profiling='false';;
amd64,linux) profiling='prof';;
amd64,openbsd) profiling='prof';;
amd64,freebsd) profiling='prof';;
amd64,netbsd) profiling='prof';;
arm,netbsd) profiling='prof';;
amd64,gnu) profiling='prof';;
arm,linux*) profiling='prof';;
power,elf) profiling='prof';;
power,bsd*) profiling='prof';;
*) profiling='noprof';;
esac

# Where is ranlib?
Expand Down Expand Up @@ -2143,7 +2143,7 @@ else
inf " compile with -fPIC........ no"
fi
inf " native dynlink ........... $natdynlink"
if $profiling; then
if test "$profiling" = "prof"; then
inf " profiling with gprof ..... supported"
else
inf " profiling with gprof ..... not supported"
Expand Down
2 changes: 0 additions & 2 deletions driver/optmain.ml
Expand Up @@ -293,8 +293,6 @@ let main () =
try
readenv ppf Before_args;
Arg.parse_expand (Arch.command_line_options @ Options.list) anonymous usage;
if !gprofile && not profiling then
fatal "Profiling with \"gprof\" is not supported on this platform.";
if !output_name <> None && !compile_only &&
List.length !process_thunks > 1 then
fatal "Options -c -o are incompatible with compiling multiple files";
Expand Down
14 changes: 6 additions & 8 deletions stdlib/Makefile
Expand Up @@ -61,14 +61,8 @@ ifeq "$(RUNTIMEI)" "true"
all: camlheaderi
endif

ifeq "$(PROFILING)" "true"
PROFILINGTARGET = prof
else
PROFILINGTARGET = noprof
endif

.PHONY: allopt
allopt: stdlib.cmxa std_exit.cmx allopt-$(PROFILINGTARGET)
allopt: stdlib.cmxa std_exit.cmx allopt-$(PROFILING)

.PHONY: allopt-noprof
allopt-noprof:
Expand Down Expand Up @@ -97,7 +91,7 @@ install::
endif

.PHONY: installopt
installopt: installopt-default installopt-$(PROFILINGTARGET)
installopt: installopt-default installopt-$(PROFILING)

.PHONY: installopt-default
installopt-default:
Expand All @@ -106,6 +100,10 @@ installopt-default:

.PHONY: installopt-noprof
installopt-noprof:
ln -sf stdlib.cmxa "$(INSTALL_LIBDIR)/stdlib.p.cmxa"
ln -sf stdlib.$(A) "$(INSTALL_LIBDIR)/stdlib.p.$(A)"
ln -sf std_exit.cmx "$(INSTALL_LIBDIR)/std_exit.p.cmx"
ln -sf std_exit.$(O) "$(INSTALL_LIBDIR)/std_exit.p.$(O)"

.PHONY: installopt-prof
installopt-prof:
Expand Down
3 changes: 0 additions & 3 deletions utils/config.mli
Expand Up @@ -136,9 +136,6 @@ val target : string

val print_config : out_channel -> unit;;

val profiling : bool
(* Whether profiling with gprof is supported on this platform *)

val flambda : bool
(* Whether the compiler was configured for flambda *)

Expand Down
2 changes: 0 additions & 2 deletions utils/config.mlp
Expand Up @@ -57,7 +57,6 @@ let mkdll, mkexe, mkmaindll =
else
"%%MKDLL%%", "%%MKEXE%%", "%%MKMAINDLL%%"

let profiling = %%PROFILING%%
let flambda = %%FLAMBDA%%
let safe_string = %%SAFE_STRING%%

Expand Down Expand Up @@ -153,7 +152,6 @@ let print_config oc =
p_bool "systhread_supported" systhread_supported;
p "host" host;
p "target" target;
p_bool "profiling" profiling;
p_bool "flambda" flambda;
p_bool "spacetime" spacetime;

Expand Down

0 comments on commit 0657fd8

Please sign in to comment.