Bug#847554: clang: Clang should produce position independent code by default

Gregor Jasny gjasny at googlemail.com
Fri Dec 9 10:45:24 UTC 2016


Package: clang
Version: 1:3.8-34
Severity: normal

Dear Maintainer,

gcc nowadys seems to be built with --enable-default-pie config option.
That flag results in generation of position independent code and
executables by default:

$ gcc -dM -E - < /dev/null|egrep -i '(pie|pic)'
#define __pie__ 2
#define __PIE__ 2
#define __pic__ 2
#define __PIC__ 2

$ g++ -o main main.cpp && readelf -h ./main | grep Type
  Type: DYN (Shared object file)

>From a useability and security perspective it would be nice if clang
could follow the GCC behaviour.

Thanks,
Gregor

-- System Information:
Debian Release: stretch/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.6.0-1-amd64 (SMP w/8 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages clang depends on:
ii  clang-3.8  1:3.8.1-16

clang recommends no packages.

clang suggests no packages.

-- no debconf information



More information about the Pkg-llvm-team mailing list