Skip to contentSkip to conversation

package/brltty: fix cross-compilation

PATCH New Yann E. MORIN 6 participants 9 messages Aug 22, 2018 – Aug 26, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/brltty: fix cross-compilation

brltty has a very inventive buildsystem, where it internall runs ./configure for the build machine In doing so, it generates a list of make variables to define what the build machine supports, like it does for the target.

However, the build variables are generated with a convoluted sed script that scans the target list, and appends _FOR_BUILD to each target variables. Then, both lists are included from the Makefile, on the assumption that the build variables will not clash with the target variables.

Where it gets interesting, is that that sed script considers the variables names to match '[A-Za-z][A-Za-z0-9_]*'

And there we see why ATSPI2_PACKAGE does not match: it contains a digit.

So, some build variables will inevitably override target ones.

Fix that by simply expanding the matching regexp to allow digits in variable names.

Fixes:

    http://autobuild.buildroot.org/results/a37/a37782b3cfc1a96cc129db8fade20a36a7b2d470/
    http://autobuild.buildroot.org/results/97e/97edc6a47d2140968e84b409cdc960604e5896f2/
Cc Mario Lang <[email protected]>
Cc Baruch Siach <[email protected]>
---
 .../0004-buildsys-fix-cross-compilation.patch      | 41 ++++++++++++++++++++++
 1 file changed, 41 insertions(+)
 create mode 100644 package/brltty/0004-buildsys-fix-cross-compilation.patch
package/brltty/0004-buildsys-fix-cross-compilation.patch new file +41 -0
new file mode 100644
index 0000000000..9a10d46414
@@ -0,0 +1,41 @@
+From 088666535a045dae71bd2fcc6b3a1553023106ce Mon Sep 17 00:00:00 2001
+From: "Yann E. MORIN" <[email protected]>
+Date: Wed, 22 Aug 2018 10:10:19 +0200
+Subject: [PATCH] buildsys: fix cross-compilation
+
+Some identifiers for includes and libs paths may contain digit, e.g.
+X11_PACKAGE or ATSPI2_PACKAGE or GLIB2_PACKAGE...
+
+Also detect those identifiers when doing cros-compilation, so that the
+_FOR_BUILD variants are really created and do not clash with the target
+variants.
+
+Fixes:
+    http://autobuild.buildroot.org/results/a37/a37782b3cfc1a96cc129db8fade20a36a7b2d470/build-end.log
+    http://autobuild.buildroot.org/results/97e/97edc6a47d2140968e84b409cdc960604e5896f2/build-end.log
+    [...]
+
+Signed-off-by: "Yann E. MORIN" <[email protected]>
+---
+Upstram status: submitted
+https://github.com/brltty/brltty/pull/142
+---
+ mk4build | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/mk4build b/mk4build
+index db90c86a9..551283825 100755
+--- a/mk4build
++++ b/mk4build
+@@ -112,7 +112,7 @@ fi
+ 
+ sedScript="${outputName}.${sedExtension}"
+ sed -n -e '
+-s/^ *\([A-Za-z][A-Za-z_]*\) *=.*$/\1/
++s/^ *\([A-Za-z][A-Za-z0-9_]*\) *=.*$/\1/
+ t found
+ d
+ :found
+-- 
+2.14.1
+
Signature · 1 line
2.14.1
#1 lore raw

PATCH 1/1 package/brltty: fix cross-compilation

Hi Yann,

Quoted 14 lines · Yann E. MORIN

brltty has a very inventive buildsystem, where it internall runs ./configure for the build machine In doing so, it generates a list of make variables to define what the build machine supports, like it does for the target.

However, the build variables are generated with a convoluted sed script that scans the target list, and appends _FOR_BUILD to each target variables. Then, both lists are included from the Makefile, on the assumption that the build variables will not clash with the target variables.

Where it gets interesting, is that that sed script considers the variables names to match '[A-Za-z][A-Za-z0-9_]*'

Quoted 7 lines

And there we see why ATSPI2_PACKAGE does not match: it contains a digit.

So, some build variables will inevitably override target ones.

Fix that by simply expanding the matching regexp to allow digits in variable names.

Thanks for fixing that.

Do you have any idea why it only fails on specific (older?) hosts? Does it depend on the sed version?

baruch

Quoted 56 lines

Fixes:

    http://autobuild.buildroot.org/results/a37/a37782b3cfc1a96cc129db8fade20a36a7b2d470/
    http://autobuild.buildroot.org/results/97e/97edc6a47d2140968e84b409cdc960604e5896f2/
Cc Mario Lang <[email protected]>
Cc Baruch Siach <[email protected]>
---
 .../0004-buildsys-fix-cross-compilation.patch      | 41 ++++++++++++++++++++++
 1 file changed, 41 insertions(+)
 create mode 100644 package/brltty/0004-buildsys-fix-cross-compilation.patch
package/brltty/0004-buildsys-fix-cross-compilation.patch new file +38 -0
new file mode 100644
index 0000000000..9a10d46414
@@ -0,0 +1,41 @@
+From 088666535a045dae71bd2fcc6b3a1553023106ce Mon Sep 17 00:00:00 2001
+From: "Yann E. MORIN" <[email protected]>
+Date: Wed, 22 Aug 2018 10:10:19 +0200
+Subject: [PATCH] buildsys: fix cross-compilation
+
+Some identifiers for includes and libs paths may contain digit, e.g.
+X11_PACKAGE or ATSPI2_PACKAGE or GLIB2_PACKAGE...
+
+Also detect those identifiers when doing cros-compilation, so that the
+_FOR_BUILD variants are really created and do not clash with the target
+variants.
+
+Fixes:
+    http://autobuild.buildroot.org/results/a37/a37782b3cfc1a96cc129db8fade20a36a7b2d470/build-end.log
+    http://autobuild.buildroot.org/results/97e/97edc6a47d2140968e84b409cdc960604e5896f2/build-end.log
+    [...]
+
+Signed-off-by: "Yann E. MORIN" <[email protected]>
+---
+Upstram status: submitted
+https://github.com/brltty/brltty/pull/142
+---
+ mk4build | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/mk4build b/mk4build
+index db90c86a9..551283825 100755
+--- a/mk4build
++++ b/mk4build
+@@ -112,7 +112,7 @@ fi
+ 
+ sedScript="${outputName}.${sedExtension}"
+ sed -n -e '
+-s/^ *\([A-Za-z][A-Za-z_]*\) *=.*$/\1/
++s/^ *\([A-Za-z][A-Za-z0-9_]*\) *=.*$/\1/
+ t found
+ d
+ :found
Signature · 3 lines
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -
#2 lore raw

PATCH 1/1 package/brltty: fix cross-compilation

Bruch, All,

On 2018-08-22 13:04 +0300, Baruch Siach spake thusly:

Quoted 20 lines · Yann E. MORIN
Quoted 19 lines

brltty has a very inventive buildsystem, where it internall runs ./configure for the build machine In doing so, it generates a list of make variables to define what the build machine supports, like it does for the target.

However, the build variables are generated with a convoluted sed script that scans the target list, and appends _FOR_BUILD to each target variables. Then, both lists are included from the Makefile, on the assumption that the build variables will not clash with the target variables.

Where it gets interesting, is that that sed script considers the variables names to match '[A-Za-z][A-Za-z0-9_]*'

And there we see why ATSPI2_PACKAGE does not match: it contains a digit.

So, some build variables will inevitably override target ones.

Quoted 7 lines
Quoted 2 lines

Fix that by simply expanding the matching regexp to allow digits in variable names.

Thanks for fixing that.

Do you have any idea why it only fails on specific (older?) hosts? Does it depend on the sed version?

I don;t know what the difference is. The sed version is probably not the culprit, because the generated file is the same on a working or on a failing system.

So, I believe I fixed the real problem, but I dont know why it sometimes did not manifest itself on some systems, while it was visible on others...

Regards,
Yann E. MORIN.

Quoted 63 lines

baruch

Quoted 56 lines

Fixes:

    http://autobuild.buildroot.org/results/a37/a37782b3cfc1a96cc129db8fade20a36a7b2d470/
    http://autobuild.buildroot.org/results/97e/97edc6a47d2140968e84b409cdc960604e5896f2/
Cc Mario Lang <[email protected]>
Cc Baruch Siach <[email protected]>
---
 .../0004-buildsys-fix-cross-compilation.patch      | 41 ++++++++++++++++++++++
 1 file changed, 41 insertions(+)
 create mode 100644 package/brltty/0004-buildsys-fix-cross-compilation.patch
package/brltty/0004-buildsys-fix-cross-compilation.patch new file +38 -0
new file mode 100644
index 0000000000..9a10d46414
@@ -0,0 +1,41 @@
+From 088666535a045dae71bd2fcc6b3a1553023106ce Mon Sep 17 00:00:00 2001
+From: "Yann E. MORIN" <[email protected]>
+Date: Wed, 22 Aug 2018 10:10:19 +0200
+Subject: [PATCH] buildsys: fix cross-compilation
+
+Some identifiers for includes and libs paths may contain digit, e.g.
+X11_PACKAGE or ATSPI2_PACKAGE or GLIB2_PACKAGE...
+
+Also detect those identifiers when doing cros-compilation, so that the
+_FOR_BUILD variants are really created and do not clash with the target
+variants.
+
+Fixes:
+    http://autobuild.buildroot.org/results/a37/a37782b3cfc1a96cc129db8fade20a36a7b2d470/build-end.log
+    http://autobuild.buildroot.org/results/97e/97edc6a47d2140968e84b409cdc960604e5896f2/build-end.log
+    [...]
+
+Signed-off-by: "Yann E. MORIN" <[email protected]>
+---
+Upstram status: submitted
+https://github.com/brltty/brltty/pull/142
+---
+ mk4build | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/mk4build b/mk4build
+index db90c86a9..551283825 100755
+--- a/mk4build
++++ b/mk4build
+@@ -112,7 +112,7 @@ fi
+ 
+ sedScript="${outputName}.${sedExtension}"
+ sed -n -e '
+-s/^ *\([A-Za-z][A-Za-z_]*\) *=.*$/\1/
++s/^ *\([A-Za-z][A-Za-z0-9_]*\) *=.*$/\1/
+ t found
+ d
+ :found
Signature · 3 lines
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -
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/brltty: fix cross-compilation

In reply to Yann E. MORIN
Quoted 22 lines · Yann E. MORIN

brltty has a very inventive buildsystem, where it internall runs ./configure for the build machine In doing so, it generates a list of make variables to define what the build machine supports, like it does for the target.

However, the build variables are generated with a convoluted sed script that scans the target list, and appends _FOR_BUILD to each target variables. Then, both lists are included from the Makefile, on the assumption that the build variables will not clash with the target variables.

Where it gets interesting, is that that sed script considers the variables names to match '[A-Za-z][A-Za-z0-9_]*'

And there we see why ATSPI2_PACKAGE does not match: it contains a digit.

So, some build variables will inevitably override target ones.

Fix that by simply expanding the matching regexp to allow digits in variable names.

Quoted 7 lines

Fixes:

    http://autobuild.buildroot.org/results/a37/a37782b3cfc1a96cc129db8fade20a36a7b2d470/
    http://autobuild.buildroot.org/results/97e/97edc6a47d2140968e84b409cdc960604e5896f2/
Cc Mario Lang <[email protected]>
Cc Baruch Siach <[email protected]>

Thanks! Forwarded to upstream.

Signature · 2 lines
CYa,
  ?????
#4 lore raw

PATCH 1/1 package/brltty: fix cross-compilation

Mario, All,

On 2018-08-22 12:12 +0200, Mario Lang spake thusly:

Quoted 5 lines
Quoted 4 lines · Yann E. MORIN

brltty has a very inventive buildsystem, where it internall runs ./configure for the build machine In doing so, it generates a list of make variables to define what the build machine supports, like it does for the target.

[--SNIP--]

Quoted 1 line

Thanks! Forwarded to upstream.

I had already sent it upstream, as PR #142, which has siunce been merged.

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.  |
'------------------------------^-------^------------------^--------------------'
#5 lore raw

PATCH 1/1 package/brltty: fix cross-compilation

In reply to Yann E. MORIN

Hello Yann,

Quoted 5 lines · Yann E. MORIN

brltty has a very inventive buildsystem, where it internall runs ./configure for the build machine In doing so, it generates a list of make variables to define what the build machine supports, like it does for the target.

Quoted 8 lines

However, the build variables are generated with a convoluted sed script that scans the target list, and appends _FOR_BUILD to each target variables. Then, both lists are included from the Makefile, on the assumption that the build variables will not clash with the target variables.

Where it gets interesting, is that that sed script considers the variables names to match '[A-Za-z][A-Za-z0-9_]*'

Minor nit: did you mean '[A-Za-z][A-Za-z_]*' here?

Regards,
Peter

Quoted 68 lines

And there we see why ATSPI2_PACKAGE does not match: it contains a digit.

So, some build variables will inevitably override target ones.

Fix that by simply expanding the matching regexp to allow digits in variable names.

Fixes:

    http://autobuild.buildroot.org/results/a37/a37782b3cfc1a96cc129db8fade20a36a7b2d470/
    http://autobuild.buildroot.org/results/97e/97edc6a47d2140968e84b409cdc960604e5896f2/
Cc Mario Lang <[email protected]>
Cc Baruch Siach <[email protected]>
---
 .../0004-buildsys-fix-cross-compilation.patch      | 41 ++++++++++++++++++++++
 1 file changed, 41 insertions(+)
 create mode 100644 package/brltty/0004-buildsys-fix-cross-compilation.patch
package/brltty/0004-buildsys-fix-cross-compilation.patch new file +41 -0
new file mode 100644
index 0000000000..9a10d46414
@@ -0,0 +1,41 @@
+From 088666535a045dae71bd2fcc6b3a1553023106ce Mon Sep 17 00:00:00 2001
+From: "Yann E. MORIN" <[email protected]>
+Date: Wed, 22 Aug 2018 10:10:19 +0200
+Subject: [PATCH] buildsys: fix cross-compilation
+
+Some identifiers for includes and libs paths may contain digit, e.g.
+X11_PACKAGE or ATSPI2_PACKAGE or GLIB2_PACKAGE...
+
+Also detect those identifiers when doing cros-compilation, so that the
+_FOR_BUILD variants are really created and do not clash with the target
+variants.
+
+Fixes:
+    http://autobuild.buildroot.org/results/a37/a37782b3cfc1a96cc129db8fade20a36a7b2d470/build-end.log
+    http://autobuild.buildroot.org/results/97e/97edc6a47d2140968e84b409cdc960604e5896f2/build-end.log
+    [...]
+
+Signed-off-by: "Yann E. MORIN" <[email protected]>
+---
+Upstram status: submitted
+https://github.com/brltty/brltty/pull/142
+---
+ mk4build | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/mk4build b/mk4build
+index db90c86a9..551283825 100755
+--- a/mk4build
++++ b/mk4build
+@@ -112,7 +112,7 @@ fi
+ 
+ sedScript="${outputName}.${sedExtension}"
+ sed -n -e '
+-s/^ *\([A-Za-z][A-Za-z_]*\) *=.*$/\1/
++s/^ *\([A-Za-z][A-Za-z0-9_]*\) *=.*$/\1/
+ t found
+ d
+ :found
+-- 
+2.14.1
+
#6 lore raw

PATCH 1/1 package/brltty: fix cross-compilation

Peter, All,

On 2018-08-22 20:01 +0200, Peter Seiderer spake thusly:

Quoted 13 lines · Yann E. MORIN
Quoted 12 lines

brltty has a very inventive buildsystem, where it internall runs ./configure for the build machine In doing so, it generates a list of make variables to define what the build machine supports, like it does for the target.

However, the build variables are generated with a convoluted sed script that scans the target list, and appends _FOR_BUILD to each target variables. Then, both lists are included from the Makefile, on the assumption that the build variables will not clash with the target variables.

Quoted 4 lines
Quoted 2 lines

Where it gets interesting, is that that sed script considers the variables names to match '[A-Za-z][A-Za-z0-9_]*'

Minor nit: did you mean '[A-Za-z][A-Za-z_]*' here?

Indeed, that's right. I copied-pasted the fix regexp...

Regards,
Yann E. MORIN.

Quoted 72 lines

Regards,
Peter

Quoted 68 lines

And there we see why ATSPI2_PACKAGE does not match: it contains a digit.

So, some build variables will inevitably override target ones.

Fix that by simply expanding the matching regexp to allow digits in variable names.

Fixes:

    http://autobuild.buildroot.org/results/a37/a37782b3cfc1a96cc129db8fade20a36a7b2d470/
    http://autobuild.buildroot.org/results/97e/97edc6a47d2140968e84b409cdc960604e5896f2/
Cc Mario Lang <[email protected]>
Cc Baruch Siach <[email protected]>
---
 .../0004-buildsys-fix-cross-compilation.patch      | 41 ++++++++++++++++++++++
 1 file changed, 41 insertions(+)
 create mode 100644 package/brltty/0004-buildsys-fix-cross-compilation.patch
package/brltty/0004-buildsys-fix-cross-compilation.patch new file +41 -0
new file mode 100644
index 0000000000..9a10d46414
@@ -0,0 +1,41 @@
+From 088666535a045dae71bd2fcc6b3a1553023106ce Mon Sep 17 00:00:00 2001
+From: "Yann E. MORIN" <[email protected]>
+Date: Wed, 22 Aug 2018 10:10:19 +0200
+Subject: [PATCH] buildsys: fix cross-compilation
+
+Some identifiers for includes and libs paths may contain digit, e.g.
+X11_PACKAGE or ATSPI2_PACKAGE or GLIB2_PACKAGE...
+
+Also detect those identifiers when doing cros-compilation, so that the
+_FOR_BUILD variants are really created and do not clash with the target
+variants.
+
+Fixes:
+    http://autobuild.buildroot.org/results/a37/a37782b3cfc1a96cc129db8fade20a36a7b2d470/build-end.log
+    http://autobuild.buildroot.org/results/97e/97edc6a47d2140968e84b409cdc960604e5896f2/build-end.log
+    [...]
+
+Signed-off-by: "Yann E. MORIN" <[email protected]>
+---
+Upstram status: submitted
+https://github.com/brltty/brltty/pull/142
+---
+ mk4build | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/mk4build b/mk4build
+index db90c86a9..551283825 100755
+--- a/mk4build
++++ b/mk4build
+@@ -112,7 +112,7 @@ fi
+ 
+ sedScript="${outputName}.${sedExtension}"
+ sed -n -e '
+-s/^ *\([A-Za-z][A-Za-z_]*\) *=.*$/\1/
++s/^ *\([A-Za-z][A-Za-z0-9_]*\) *=.*$/\1/
+ t found
+ d
+ :found
+-- 
+2.14.1
+
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.  |
'------------------------------^-------^------------------^--------------------'
#7 lore raw

PATCH 1/1 package/brltty: fix cross-compilation

In reply to Yann E. MORIN

Hello,

Quoted 26 lines · Yann E. MORIN

brltty has a very inventive buildsystem, where it internall runs ./configure for the build machine In doing so, it generates a list of make variables to define what the build machine supports, like it does for the target.

However, the build variables are generated with a convoluted sed script that scans the target list, and appends _FOR_BUILD to each target variables. Then, both lists are included from the Makefile, on the assumption that the build variables will not clash with the target variables.

Where it gets interesting, is that that sed script considers the variables names to match '[A-Za-z][A-Za-z0-9_]*'

And there we see why ATSPI2_PACKAGE does not match: it contains a digit.

So, some build variables will inevitably override target ones.

Fix that by simply expanding the matching regexp to allow digits in variable names.

Fixes:

    http://autobuild.buildroot.org/results/a37/a37782b3cfc1a96cc129db8fade20a36a7b2d470/
    http://autobuild.buildroot.org/results/97e/97edc6a47d2140968e84b409cdc960604e5896f2/
Quoted 7 lines
Cc Mario Lang <[email protected]>
Cc Baruch Siach <[email protected]>
---
 .../0004-buildsys-fix-cross-compilation.patch      | 41 ++++++++++++++++++++++
 1 file changed, 41 insertions(+)
 create mode 100644 package/brltty/0004-buildsys-fix-cross-compilation.patch

Applied to master, thanks.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
#8 lore raw

PATCH 1/1 package/brltty: fix cross-compilation

In reply to Yann E. MORIN
Quoted 24 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Yann" == Yann E MORIN <[email protected]> writes:

brltty has a very inventive buildsystem, where it internall runs ./configure for the build machine In doing so, it generates a list of make variables to define what the build machine supports, like it does for the target.

However, the build variables are generated with a convoluted sed script that scans the target list, and appends _FOR_BUILD to each target variables. Then, both lists are included from the Makefile, on the assumption that the build variables will not clash with the target variables.

Where it gets interesting, is that that sed script considers the variables names to match '[A-Za-z][A-Za-z0-9_]*'

And there we see why ATSPI2_PACKAGE does not match: it contains a digit.

So, some build variables will inevitably override target ones.

Fix that by simply expanding the matching regexp to allow digits in variable names.

Quoted 7 lines

Fixes:

    http://autobuild.buildroot.org/results/a37/a37782b3cfc1a96cc129db8fade20a36a7b2d470/
    http://autobuild.buildroot.org/results/97e/97edc6a47d2140968e84b409cdc960604e5896f2/
Cc Mario Lang <[email protected]>
Cc Baruch Siach <[email protected]>

Committed to 2018.02.x and 2018.05.x, thanks.

Signature · 1 line
Bye, Peter Korsgaard