Skip to contentSkip to conversation

package/flex: really disable flex program

PATCH New Yann E. MORIN 2 participants 4 messages Sep 29, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/flex: really disable flex program

Commit c128c5f3c7 (flex: Fix segfault of stage1flex when host has glibc 2.26 or newer) introduced an autoreconf of flex, but forgot to properly account for the quirky way the flex program is disabled.

So far, we used to sed-out the bin_PROGRAMS from Makefile.in. But now that we autoreconf, Makefile.in gets regenerated, and this breaks the build on noMMU systems.

Since we autoreconf, let's add a patch to remove the flex binary altogether.

Fixes:

    http://autobuild.buildroot.org/results/f70/f70b39632535bb9692d0a032166b2f4104532967/
    http://autobuild.buildroot.org/results/525/52567afdfe7992b3518de0e01227ba14aa300f21/
    [...]
Cc Adrian Perez de Castro <[email protected]>
Cc Thomas Petazzoni <[email protected]>
Cc Arnout Vandecappelle <[email protected]>
---
 .../0003-build-never-build-the-flex-program.patch  | 42 ++++++++++++++++++++++
 package/flex/flex.mk                               | 11 ------
 2 files changed, 42 insertions(+), 11 deletions(-)
 create mode 100644 package/flex/0003-build-never-build-the-flex-program.patch
package/flex/0003-build-never-build-the-flex-program.patch new file +42 -0
new file mode 100644
index 0000000000..550df179c9
@@ -0,0 +1,42 @@
+From 097a4408b83a0bf8c584bbe4fe0239581b183732 Mon Sep 17 00:00:00 2001
+From: "Yann E. MORIN" <[email protected]>
+Date: Fri, 29 Sep 2017 15:41:14 +0200
+Subject: [PATCH] build: never build the flex program
+
+Signed-off-by: "Yann E. MORIN" <[email protected]>
+
+---
+Upstream status: not suitable, only for Buildroot.
+---
+ Makefile.am     | 4 ----
+ src/Makefile.am | 1 -
+ 2 files changed, 5 deletions(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index 9db3420..3d61159 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -58,8 +58,4 @@ ChangeLog: $(srcdir)/tools/git2cl
+ indent:
+ 	cd src && $(MAKE) $(AM_MAKEFLAGS) indent
+ 
+-install-exec-hook:
+-	cd $(DESTDIR)$(bindir) && \
+-		$(LN_S) -f flex$(EXEEXT) flex++$(EXEEXT)
+-
+ .PHONY: ChangeLog indent
+diff --git a/src/Makefile.am b/src/Makefile.am
+index e379692..29d7560 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -4,7 +4,6 @@ LIBS = @LIBS@
+ 
+ m4 = @M4@
+ 
+-bin_PROGRAMS = flex
+ if ENABLE_BOOTSTRAP
+ noinst_PROGRAMS = stage1flex
+ endif
+-- 
+2.11.0
+
package/flex/flex.mk +0 -11
index aeac4ada87..f550ce499c 100644
@@ -20,16 +20,5 @@ FLEX_CONF_ENV = ac_cv_path_M4=/usr/bin/m4 \
 
 HOST_FLEX_DEPENDENCIES = host-m4
 
-define FLEX_DISABLE_PROGRAM
-	$(SED) 's/^bin_PROGRAMS.*//' $(@D)/src/Makefile.in
-endef
-FLEX_POST_PATCH_HOOKS += FLEX_DISABLE_PROGRAM
-
-# flex++ symlink is broken when flex binary is not installed
-define FLEX_REMOVE_BROKEN_SYMLINK
-	rm -f $(TARGET_DIR)/usr/bin/flex++
-endef
-FLEX_POST_INSTALL_TARGET_HOOKS += FLEX_REMOVE_BROKEN_SYMLINK
-
 $(eval $(autotools-package))
 $(eval $(host-autotools-package))
Signature · 1 line
2.11.0
#1 lore raw

PATCH 1/1 package/flex: really disable flex program

Hello,

package/flex/0003-build-never-build-the-flex-program.patch line 4

Quoted 10 lines · Yann E. MORIN
package/flex/0003-build-never-build-the-flex-program.patch new file +4 -0
new file mode 100644
index 0000000000..550df179c9
@@ -0,0 +1,42 @@
+From 097a4408b83a0bf8c584bbe4fe0239581b183732 Mon Sep 17 00:00:00 2001
+From: "Yann E. MORIN" <[email protected]>
+Date: Fri, 29 Sep 2017 15:41:14 +0200
+Subject: [PATCH] build: never build the flex program

This will also disable the build of flex the program in host-flex, which is not good: we want host-flex to install the flex program.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
#2 lore raw

PATCH 1/1 package/flex: really disable flex program

On 2017-09-29 15:49 +0200, Thomas Petazzoni spake thusly:

Quoted 4 lines

Hello,

On Fri, 29 Sep 2017 15:47:09 +0200, Yann E. MORIN wrote:

Quoted 13 lines

package/flex/0003-build-never-build-the-flex-program.patch line 4

Quoted 10 lines
package/flex/0003-build-never-build-the-flex-program.patch new file +4 -0
new file mode 100644
index 0000000000..550df179c9
@@ -0,0 +1,42 @@
+From 097a4408b83a0bf8c584bbe4fe0239581b183732 Mon Sep 17 00:00:00 2001
+From: "Yann E. MORIN" <[email protected]>
+Date: Fri, 29 Sep 2017 15:41:14 +0200
+Subject: [PATCH] build: never build the flex program

This will also disable the build of flex the program in host-flex, which is not good: we want host-flex to install the flex program.

Right, I missed that in turn.

I guess I'll have to early-port your flex patch instead... Sigh...

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#3 lore raw

PATCH 1/1 package/flex: really disable flex program

Hello,

Quoted 6 lines · Yann E. MORIN
Quoted 2 lines

This will also disable the build of flex the program in host-flex, which is not good: we want host-flex to install the flex program.

Right, I missed that in turn.

I guess I'll have to early-port your flex patch instead... Sigh...

There's a reason why I added a --disable-something option in the first place :)

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com