pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

pkg/38001: wrappers need magic to disable optimization on a per file basis



>Number:         38001
>Category:       pkg
>Synopsis:       wrappers need magic to disable optimization on a per file basis
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Mon Feb 11 23:00:01 +0000 2008
>Originator:     Dan McMahill
>Release:        pkgsrc as of February, 2008
>Organization:
NetBSD
>Environment:
        
        
System: NetBSD bondage 2.0_STABLE NetBSD 2.0_STABLE (BONDAGE) #0: Tue Mar 29 
13:12:53 EST 2005 
dan@bondage:/export/disk2/netbsd-2/obj/alpha/sys/arch/alpha/compile/BONDAGE 
alpha
Architecture: alpha
Machine: alpha
>Description:

It would be most useful if pkgsrc provided a magic variable that lowered the 
optimization level on
particular files.  For example

NOOPT_SRCS+=    lib/foo.c
NOOPT_SRCS+=    src/foo.cc

The idea is that the listed files are relative to ${WRKSRC} and the compiler 
wrappers will remove any -O[1-9]? flags
when compiling those particular files.

There have historically been a number of packages in pkgsrc which have had to 
do this and it
always involves somewhat painful patching of the makefiles in the package.  
This patching takes
some effort to to ensure that the only change is to remove the optimization 
flag.

This is an example Makefile.am patch:

--- src/Makefile.am.orig
+++ src/Makefile.am
@@ -131,4 +131,22 @@
 CLEANFILES= ${MODELSRCS}
  
+##
+## workaround for g++ bugs
+CXXCOMPILE_NOOPT = $(CXXCOMPILE:-O%=)
+
+d_mos5.o : d_mos5.cc
+@am__fastdepCXX_TRUE@  if $(CXXCOMPILE_NOOPT) -MT $@ -MD -MP -MF 
"$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@  then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else 
rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='$<' object='$@' libtool=no 
@AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) 
$(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXXCOMPILE_NOOPT) -c -o $@ $<
+
+d_mos5.obj : d_mos5.cc
+@am__fastdepCXX_TRUE@  if $(CXXCOMPILE_NOOPT) -MT $@ -MD -MP -MF 
"$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCXX_TRUE@  then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else 
rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='$<' object='$@' libtool=no 
@AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) 
$(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXXCOMPILE_NOOPT) -c -o $@ `$(CYGPATH_W) '$<'`
+

having the hooks directly in pkgsrc would be easier.

        
>How-To-Repeat:

build a package that triggers compiler errors with optimization.  

        
>Fix:
        

>Unformatted:
        
        


Home | Main Index | Thread Index | Old Index