components/python/python34/patches/05-studio-profile.patch
branchs11-update
changeset 3876 da37433d5103
parent 3786 fa9d2da4d216
child 5229 b7b91ddbbdce
equal deleted inserted replaced
3870:37ef66e7f75b 3876:da37433d5103
     2 Studio instead of gcc.  The unfortunate repetition of options seen below
     2 Studio instead of gcc.  The unfortunate repetition of options seen below
     3 is a workaround for build peculiarities and to meet Studio's requirement
     3 is a workaround for build peculiarities and to meet Studio's requirement
     4 that the profiling options be used at all steps of the build -- not just
     4 that the profiling options be used at all steps of the build -- not just
     5 compilation.  As it is Solaris-specific, it is not suitable for upstream.
     5 compilation.  As it is Solaris-specific, it is not suitable for upstream.
     6 
     6 
     7 --- Python-3.4.2/Makefile.pre.in.~2~	2014-09-22 14:03:21.153426271 -0700
     7 --- Python-3.4.3/Makefile.pre.in.~2~	2015-02-25 08:04:46.338074390 -0800
     8 +++ Python-3.4.2/Makefile.pre.in	2014-09-22 14:03:21.234552368 -0700
     8 +++ Python-3.4.3/Makefile.pre.in	2015-02-25 08:04:46.418252956 -0800
     9 @@ -477,30 +477,39 @@
     9 @@ -478,30 +478,39 @@
    10  profile-opt:
    10  profile-opt:
    11  	@echo "Building with support for profile generation:"
    11  	@echo "Building with support for profile generation:"
    12  	$(MAKE) clean
    12  	$(MAKE) clean
    13 +	$(MAKE) profile-removal
    13 +	$(MAKE) profile-removal
    14  	$(MAKE) build_all_generate_profile
    14  	$(MAKE) build_all_generate_profile
    18  	@echo "Rebuilding with profile guided optimizations:"
    18  	@echo "Rebuilding with profile guided optimizations:"
    19  	$(MAKE) clean
    19  	$(MAKE) clean
    20  	$(MAKE) build_all_use_profile
    20  	$(MAKE) build_all_use_profile
    21  
    21  
    22  build_all_generate_profile:
    22  build_all_generate_profile:
    23 -	$(MAKE) all CFLAGS="$(CFLAGS) -fprofile-generate" LIBS="$(LIBS) -lgcov"
    23 -	$(MAKE) all CFLAGS_NODIST="$(CFLAGS) -fprofile-generate" LDFLAGS="-fprofile-generate" LIBS="$(LIBS) -lgcov"
    24 +	$(MAKE) all CC="$(CC) -xprofile=collect:$(XPROFILE_DIR)" \
    24 +	$(MAKE) all CC="$(CC) -xprofile=collect:$(XPROFILE_DIR)" \
    25 +	    CFLAGS="$(CFLAGS) -xprofile=collect:$(XPROFILE_DIR)" \
    25 +	    CFLAGS_NODIST="$(CFLAGS) -xprofile=collect:$(XPROFILE_DIR)" \
    26 +	    LDFLAGS="$(LDFLAGS) -xprofile=collect:$(XPROFILE_DIR)" \
    26 +	    LDFLAGS="$(LDFLAGS) -xprofile=collect:$(XPROFILE_DIR)" \
    27 +	    BLDSHARED="$(BLDSHARED) -xprofile=collect:$(XPROFILE_DIR)"
    27 +	    BLDSHARED="$(BLDSHARED) -xprofile=collect:$(XPROFILE_DIR)"
    28  
    28  
    29  run_profile_task:
    29  run_profile_task:
    30  	: # FIXME: can't run for a cross build
    30  	: # FIXME: can't run for a cross build
    31 -	$(RUNSHARED) ./$(BUILDPYTHON) $(PROFILE_TASK)
    31 -	$(RUNSHARED) ./$(BUILDPYTHON) $(PROFILE_TASK)
    32 +	LD_LIBRARY_PATH=. $(RUNSHARED) ./$(BUILDPYTHON) $(PROFILE_TASK)
    32 +	LD_LIBRARY_PATH=. $(RUNSHARED) ./$(BUILDPYTHON) $(PROFILE_TASK)
    33  
    33  
    34  build_all_use_profile:
    34  build_all_use_profile:
    35 -	$(MAKE) all CFLAGS="$(CFLAGS) -fprofile-use -fprofile-correction"
    35 -	$(MAKE) all CFLAGS_NODIST="$(CFLAGS) -fprofile-use -fprofile-correction"
    36 +	$(MAKE) all CC="$(CC) -xprofile=use:$(XPROFILE_DIR)" \
    36 +	$(MAKE) all CC="$(CC) -xprofile=use:$(XPROFILE_DIR)" \
    37 +	    CFLAGS="$(CFLAGS) -xprofile=use:$(XPROFILE_DIR)" \
    37 +	    CFLAGS_NODIST="$(CFLAGS) -xprofile=use:$(XPROFILE_DIR)" \
    38 +	    LDFLAGS="$(LDFLAGS) -xprofile=use:$(XPROFILE_DIR)" \
    38 +	    LDFLAGS="$(LDFLAGS) -xprofile=use:$(XPROFILE_DIR)" \
    39 +	    BLDSHARED="$(BLDSHARED) -xprofile=use:$(XPROFILE_DIR)"
    39 +	    BLDSHARED="$(BLDSHARED) -xprofile=use:$(XPROFILE_DIR)"
    40  
    40  
    41  # Compile and run with gcov
    41  # Compile and run with gcov
    42  .PHONY=coverage coverage-lcov coverage-report
    42  .PHONY=coverage coverage-lcov coverage-report
    49 +	    LDFLAGS="$(LDFLAGS) -xprofile=tcov" \
    49 +	    LDFLAGS="$(LDFLAGS) -xprofile=tcov" \
    50 +	    BLDSHARED="$(BLDSHARED) -xprofile=tcov"
    50 +	    BLDSHARED="$(BLDSHARED) -xprofile=tcov"
    51  
    51  
    52  coverage-lcov:
    52  coverage-lcov:
    53  	@echo "Creating Coverage HTML report with LCOV:"
    53  	@echo "Creating Coverage HTML report with LCOV:"
    54 @@ -571,13 +580,9 @@
    54 @@ -572,13 +581,9 @@
    55  # -s, --silent or --quiet is always the first char.
    55  # -s, --silent or --quiet is always the first char.
    56  # Under BSD make, MAKEFLAGS might be " -s -v x=y".
    56  # Under BSD make, MAKEFLAGS might be " -s -v x=y".
    57  sharedmods: $(BUILDPYTHON) pybuilddir.txt
    57  sharedmods: $(BUILDPYTHON) pybuilddir.txt
    58 -	@case "$$MAKEFLAGS" in \
    58 -	@case "$$MAKEFLAGS" in \
    59 -	    *\ -s*|s*) quiet="-q";; \
    59 -	    *\ -s*|s*) quiet="-q";; \
    64 -		$(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build
    64 -		$(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build
    65 +		$(PYTHON_FOR_BUILD) $(srcdir)/setup.py build
    65 +		$(PYTHON_FOR_BUILD) $(srcdir)/setup.py build
    66  
    66  
    67  # Build static library
    67  # Build static library
    68  # avoid long command lines, same as LIBRARY_OBJS
    68  # avoid long command lines, same as LIBRARY_OBJS
    69 @@ -1591,7 +1596,7 @@
    69 @@ -1595,7 +1600,7 @@
    70  	-rm -f Modules/_testembed Modules/_freeze_importlib
    70  	-rm -f Modules/_testembed Modules/_freeze_importlib
    71  
    71  
    72  profile-removal:
    72  profile-removal:
    73 -	find . -name '*.gc??' -exec rm -f {} ';'
    73 -	find . -name '*.gc??' -exec rm -f {} ';'
    74 +	find . -name '*profile' -exec rm -f {} ';'
    74 +	find . -name '*profile' -exec rm -f {} ';'