Skip to contentSkip to conversation

build: Enable BIND_NOW

PATCH In review Bastien Nocera 2 participants 6 messages Aug 24, 2017 – Nov 24, 2017 Bluetooth drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 build: Enable BIND_NOW

From: Florian Weimer <[email protected]>

Partial RELRO means that the object is GNU_RELRO but not BIND_NOW. This reduces the effectiveness of RELRO. bluez triggers this because it enables PIE during the build, and rpmdiff takes this as an indicator that the best possible hardening is desired.

https://bugzilla.redhat.com/show_bug.cgi?id=983161

---
 acinclude.m4 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
acinclude.m4 +1 -1
index bc39c6d73..efce2f3cb 100644
@@ -50,7 +50,7 @@ AC_DEFUN([MISC_FLAGS], [
 		if (test "${enableval}" = "yes" &&
 				test "${ac_cv_prog_cc_pie}" = "yes"); then
 			misc_cflags="$misc_cflags -fPIC"
-			misc_ldflags="$misc_ldflags -pie"
+			misc_ldflags="$misc_ldflags -pie -Wl,-z,now"
 		fi
 	])
 	if (test "$enable_coverage" = "yes"); then
Signature · 1 line
2.13.5
#1 lore raw

PATCH 2/3 obexd: Fix compilation error on F27

In file included from obexd/plugins/mas.c:41:0:
./obexd/src/obex.h:37:1: error: unknown type name ‘ssize_t’; did you mean ‘size_t’?
ssize_t obex_get_size(struct obex_session *os);
^~~~~~~

---
 obexd/src/obex.h | 2 ++
 1 file changed, 2 insertions(+)
obexd/src/obex.h +2 -0
index fc1674755..67593f11b 100644
@@ -22,6 +22,8 @@
  *
  */
 
+#include <unistd.h>
+
 #define OBJECT_SIZE_UNKNOWN -1
 #define OBJECT_SIZE_DELETE -2
 
Signature · 1 line
2.13.5
#2 lore raw

PATCH 3/3 build: Add a few default configure options

In reply to Bastien Nocera

Add 3 optional features that are currently used and distributed in the Fedora packages to the default build configuration.

The additional build time is minimal, and it ensures that the build gets maximum coverage.

---
 bootstrap-configure | 3 +++
 1 file changed, 3 insertions(+)
bootstrap-configure +3 -0
index 658eef296..cb19b56bd 100755
@@ -24,4 +24,7 @@ fi
 		--enable-sixaxis \
 		--enable-midi \
 		--enable-mesh \
+		--enable-pie \
+		--enable-cups \
+		--enable-library \
 		--disable-datafiles $*
Signature · 1 line
2.13.5
#3 lore raw

Re: [PATCH 3/3] build: Add a few default configure options

Quoted 5 lines · Bastien Nocera

Add 3 optional features that are currently used and distributed in the Fedora packages to the default build configuration.

The additional build time is minimal, and it ensures that the build gets maximum coverage.

This still applies as well.

#4 lore raw
In reply to Bastien Nocera
Quoted 9 lines · Bastien Nocera

From: Florian Weimer <[email protected]>

Partial RELRO means that the object is GNU_RELRO but not BIND_NOW. This
reduces the effectiveness of RELRO. bluez triggers this because it enables PIE during the build, and rpmdiff takes this as an indicator that the best possible hardening is desired.

https://bugzilla.redhat.com/show_bug.cgi?id=983161

Florian made the comments, I made the patch and sent it. Feel free to remove the internal Bugzilla reference before pushing.

Cheers

#5 lore raw
Quoted 9 lines · Bastien Nocera
Quoted 8 lines · Bastien Nocera

From: Florian Weimer <[email protected]>

Partial RELRO means that the object is GNU_RELRO but not BIND_NOW. This
reduces the effectiveness of RELRO. bluez triggers this because it enables PIE during the build, and rpmdiff takes this as an indicator that the best possible hardening is desired.

Quoted 4 lines
Quoted 1 line

https://bugzilla.redhat.com/show_bug.cgi?id=983161

Florian made the comments, I made the patch and sent it. Feel free to remove the internal Bugzilla reference before pushing.

It might be simpler to just pass through any CC/CFLAGS/LDFLAGS settings the build environment is using, without trying to second-guess what the user is doing.

Thanks,
Florian