Skip to contentSkip to conversation

package/libsodium: add config for full build

PATCH Superseded Adrien Gallouët 2 participants 3 messages Sep 21, 2019 – Sep 22, 2019

v2 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 package/libsodium: add config for full build

By default, build libsodium in the minimal mode.
A new option is added to build seldom used or obsolete (not recommended) functions.

---
Changes v1 -> v2:
- full build (suggested by Arnout Vandecappelle)

---
 package/libsodium/Config.in    | 9 +++++++++
 package/libsodium/libsodium.mk | 4 ++++
 2 files changed, 13 insertions(+)
package/libsodium/Config.in +9 -0
index 47b9bb350c..36e2f35df1 100644
@@ -4,3 +4,12 @@ config BR2_PACKAGE_LIBSODIUM
 	  A modern and easy-to-use crypto library.
 
 	  http://libsodium.org/
+
+if BR2_PACKAGE_LIBSODIUM
+
+config BR2_PACKAGE_LIBSODIUM_FULL
+	bool "Add seldom used or obsolete functions"
+	help
+	  Build libsodium with all functions.
+
+endif
package/libsodium/libsodium.mk +4 -0
index a94a8271c5..9afa09ff37 100644
@@ -14,5 +14,9 @@ ifeq ($(BR2_TOOLCHAIN_SUPPORTS_PIE),)
 LIBSODIUM_CONF_OPTS += --disable-pie
 endif
 
+ifeq ($(BR2_PACKAGE_LIBSODIUM_FULL),)
+LIBSODIUM_CONF_OPTS += --enable-minimal
+endif
+
 $(eval $(autotools-package))
 $(eval $(host-autotools-package))
Signature · 1 line
2.19.1
#1 lore raw

PATCH v2 1/1 package/libsodium: add config for full build

Hi Adrien,

Thanks for this update. However, I'll repeat two comments I made earlier, could
you reply to those? Maybe it's OK as it is, I just want to be sure I understand.

Quoted 18 lines · Adrien Gallou?t

By default, build libsodium in the minimal mode.
A new option is added to build seldom used or obsolete (not recommended) functions.

---
Changes v1 -> v2:
- full build (suggested by Arnout Vandecappelle)

---
 package/libsodium/Config.in    | 9 +++++++++
 package/libsodium/libsodium.mk | 4 ++++
 2 files changed, 13 insertions(+)
package/libsodium/Config.in +0 -0
index 47b9bb350c..36e2f35df1 100644

package/libsodium/Config.in config BR2_PACKAGE_LIBSODIUM · line 11

Quoted 8 lines
package/libsodium/Config.in +5 -0
@@ -4,3 +4,12 @@ config BR2_PACKAGE_LIBSODIUM
 	  A modern and easy-to-use crypto library.
 
 	  http://libsodium.org/
+
+if BR2_PACKAGE_LIBSODIUM
+
+config BR2_PACKAGE_LIBSODIUM_FULL
+	bool "Add seldom used or obsolete functions"

This should default to y, in order not to break existing configs.

package/libsodium/Config.in config BR2_PACKAGE_LIBSODIUM · line 13

Quoted 2 lines
package/libsodium/Config.in +2 -0
+	help
+	  Build libsodium with all functions.

I would turn the prompt and the help text around. So

bool "all functions"
default y
help
Build all seldom used and obsolete functions. Without this option, only the minimal set of normally used functions is built.

It would also be nice if there was a reference (URL) that you could add to show
which functions are built or not built with this option.

package/libsodium/libsodium.mk ifeq ($(BR2_TOOLCHAIN_SUPPORTS_PIE),) · line 18

Quoted 12 lines
package/libsodium/Config.in +2 -0
+
+endif
package/libsodium/libsodium.mk +2 -0
index a94a8271c5..9afa09ff37 100644
@@ -14,5 +14,9 @@ ifeq ($(BR2_TOOLCHAIN_SUPPORTS_PIE),)
 LIBSODIUM_CONF_OPTS += --disable-pie
 endif
 
+ifeq ($(BR2_PACKAGE_LIBSODIUM_FULL),)
+LIBSODIUM_CONF_OPTS += --enable-minimal

We prefer to be explicit, so --disable-minimal if the other case. If that works.

Regards,
Arnout

Quoted 5 lines
package/libsodium/libsodium.mk +2 -0
+endif
+
 $(eval $(autotools-package))
 $(eval $(host-autotools-package))
#2 lore raw

PATCH v2 1/1 package/libsodium: add config for full build

Hi Arnout,

Quoted 39 lines · Arnout Vandecappelle

Hi Adrien,

Thanks for this update. However, I'll repeat two comments I made earlier, could
you reply to those? Maybe it's OK as it is, I just want to be sure I understand.

Quoted 18 lines · Adrien Gallou?t

By default, build libsodium in the minimal mode.
A new option is added to build seldom used or obsolete (not recommended) functions.

---
Changes v1 -> v2:
- full build (suggested by Arnout Vandecappelle)

---
 package/libsodium/Config.in    | 9 +++++++++
 package/libsodium/libsodium.mk | 4 ++++
 2 files changed, 13 insertions(+)
package/libsodium/Config.in +0 -0
index 47b9bb350c..36e2f35df1 100644

package/libsodium/Config.in config BR2_PACKAGE_LIBSODIUM · line 11

Quoted 8 lines
package/libsodium/Config.in +5 -0
@@ -4,3 +4,12 @@ config BR2_PACKAGE_LIBSODIUM
        A modern and easy-to-use crypto library.
 
        http://libsodium.org/
+
+if BR2_PACKAGE_LIBSODIUM
+
+config BR2_PACKAGE_LIBSODIUM_FULL
+     bool "Add seldom used or obsolete functions"

This should default to y, in order not to break existing configs.

package/libsodium/Config.in config BR2_PACKAGE_LIBSODIUM · line 13

Quoted 2 lines
package/libsodium/Config.in +2 -0
+     help
+       Build libsodium with all functions.
Quoted 8 lines

I would turn the prompt and the help text around. So

bool "all functions"
default y
help
Build all seldom used and obsolete functions. Without this option, only the minimal set of normally used functions is built.

Yes, this is far better, I'll update the commit this way.

Quoted 2 lines

It would also be nice if there was a reference (URL) that you could add to show
which functions are built or not built with this option.

The only information on the minimal set in the documentation is (which is not completely true):
"The test suite covers all the functions, symbols and macros of a library built with --enable-minimal".
Also, most of the functions not present in the minimal set are not documented.

Quoted 11 lines
Quoted 11 lines
package/libsodium/Config.in +2 -0
+
+endif
package/libsodium/libsodium.mk +0 -0
index a94a8271c5..9afa09ff37 100644
@@ -14,5 +14,9 @@ ifeq ($(BR2_TOOLCHAIN_SUPPORTS_PIE),)
 LIBSODIUM_CONF_OPTS += --disable-pie
 endif
 
Quoted 4 lines

package/libsodium/libsodium.mk ifeq ($(BR2_TOOLCHAIN_SUPPORTS_PIE),) · line 18

Quoted 2 lines
package/libsodium/libsodium.mk +2 -0
+ifeq ($(BR2_PACKAGE_LIBSODIUM_FULL),)
+LIBSODIUM_CONF_OPTS += --enable-minimal

We prefer to be explicit, so --disable-minimal if the other case. If that works.

Sorry, I forgot to point it out, it is not possible.

Quoted 10 lines

Regards,
Arnout

package/libsodium/libsodium.mk ifeq ($(BR2_TOOLCHAIN_SUPPORTS_PIE),) · line 22

Quoted 5 lines
package/libsodium/libsodium.mk +2 -0
+endif
+
 $(eval $(autotools-package))
 $(eval $(host-autotools-package))

Best regards,
Adrien