There is no way to set this absolutely globally, short of patching the compiler itself. There is no firm policy for configuring this thing. The dpkg-buildflags
approach is an attempt to unify this to some degree, bit it is still young. It should work for most packages, but if it doesn't, you'll have to patch the source package (and perhaps inform the package maintainer to sort this out).
In a strict sense a binary file is one which is not character encoded as human readable text. More colloquially, a "binary" refers to a file that is compiled, executable code, although the file itself may not be executable (referring not so much to permissions as to the capacity to be run alone; some binary code files such as libraries are compiled, but regardless of permissions, they cannot be executed all by themselves). A binary which runs as a standalone executable is an "executable", although not all executable files are binaries (and this is about permissions: executable text files which invoke an interpreter via a shebang such as #!/bin/sh
are executables too).
What is a binary package?
A binary package in a linux context is an application package which contains (pre-built) executables, as opposed to source code.
Note that this does not mean a package file is itself an executable. A package file is an archive (sort of like a .zip
) which contains other files, and a "binary" package file is one which specifically contains executables (although again, executables are not necessarily truly binaries, and in fact binary packages may be used for compiled libraries which are binary code, but not executables). However, the package must be unpacked in order for you to access these files.
Usually that is taken care of for you by a package management system (e.g. apt/dpkg) which downloads the package and unpacks and installs the binaries inside for you.
What is diference between binary package and deb package?
There isn't -- .deb
packages are binary packages, although there are .deb
s which contain source instead, these usually have -src
appended to their name.
I run some direct package which is in "xyz.linux.run" format What are these package?
Those are generally self-extracting binary packages; they work by embedding a binary payload into a shell script. "Self-extracting" means you don't have to invoke another application (such as a package manager) in order to unpack and use them. However, since they do not work with a package manager, resolving their dependencies may be more of a crapshoot and hence some such packages use statically linked executables (they have all necessary libraries built into them) which wastes a bit of memory when they are used.
Best Answer
The compiler flags used are a function of
debian/rules
file,dh
,cdbs
etc.),To see the flags used you effectively need to at least compile the package:
Trying things like
generally won't take you very far; for instance on a
dh
-based package it will just sayor something similar; asking
dh
to show what that would do (with--no-act
) will produceand so on.
There is no fool-proof, easy-to-explain way to determine the build flags by reading
debian/rules
; you can get some idea by looking for flags set there, and also (where appropriate) by looking for options fordpkg-buildflags
(such asDEB_BUILD_MAINT_OPTIONS
) and running that. For many packages the easiest way to see what flags were used is to look at the build logs for the packages shipped in the archives, starting from https://buildd.debian.org. For example the logs forcoreutils
oni386
show that the flags used were-Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -fstack-protector-strong -Wformat -Werror=format-security
for compilation, and-g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wl,--as-needed -Wl,-z,relro
for linking (thanks to Faheem Mitha for pointing out the latter!).