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

Re: [PROPOSAL] changing policy on compiling with -g .. a better way



> I think I like this. One can then set the variable, and do
> dpkg-buildpackage, or even use a build daemon to build a whole set
> of debuggable packages, should the need arise.

Yep.

> 		  One can still suggest that a two line addition
> build-debug: BUILD_DEBUG=y
> build-debug: build
> 		  Would add the OPTIONAL build-debug target, which can still be
>  useful for some people.

Maintainers can do that if they like. But IMHO it's too much to
require this, too, in policy. It should be only a suggestion.

May I come up with a wording proposal?

          CC = gcc
-         CFLAGS = -O2 -g -Wall # sane warning options vary between programs
+         CFLAGS = -O2 -Wall # sane warning options vary between programs
          LDFLAGS = # none
          install -s # (or use strip on the files in debian/tmp)
...

-	  The `-g' flag is useful on compilation so that you have available a
-	  full set of debugging symbols in your built source tree, in case
-	  anyone should file a bug report involving (for example) a core dump.
+     The `-g' flag should not be used for normal package builds, because
+     the debugging infos are stripped off the installed binaries later
+     anyway. But if an environment variable BUILD_DEBUG is set to `yes',
+     compilation should be done with -g. The resulting binaries in your
+     built source tree will then contain the full set of debugging
+     symbols, in case anyone should file a bug report involving (for
+     example) a core dump. You can also provide a target `build-debug' in
+     debian/rules which has the same effect like setting BUILD_DEBUG to
+     `yes'.

I've intentionally used the term "should" most of the time, as the issue
isn't too important. If there are (really) good reasons to do it
differently, this shouldn't be strictly forbidden.

Roman


Reply to: