Skip to contentSkip to conversation

package/gcnano-binaries: create symlinks for libGLESv2 and libGLESv1_CM.so

PATCH Applied Thomas Petazzoni via buildroot 2 participants 5 messages Aug 4, 2022 – Aug 6, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 package/gcnano-binaries: create symlinks for libGLESv2 and libGLESv1_CM.so

At least libepoxy, a user of OpenGL ES, expects libraries to be available as libGLESv2.so.2 and libGLESv1_CM.so.1. While other OpenGL implementations comply with this, gcnano-binaries does not, and installs its libraries directly as .so, without any ABI version, causing runtime failures with libepoxy or SDL2, as it tries to dlopen() the OpenGL ES libraries with their ABI suffix.

See for example the libepoxy code:

https://github.com/anholt/libepoxy/blob/master/src/dispatch_common.c#L191

Fix this issue by adding the relevant symlinks.

---
 package/gcnano-binaries/gcnano-binaries.mk | 7 +++++++
 1 file changed, 7 insertions(+)
package/gcnano-binaries/gcnano-binaries.mk +7 -0
index dc309ec3c2..ce9b24cc3a 100644
@@ -44,10 +44,17 @@ GCNANO_BINARIES_MODULE_MAKE_OPTS = \
 
 GCNANO_BINARIES_USERLAND_SUBDIR = gcnano-userland-multi-$(GCNANO_BINARIES_USERLAND_VERSION)
 
+# This creates:
+#   libGLESv2.so.2    -> libGLESv2.so
+#   libGLESv1_CM.so.1 -> libGLESv1_CM.so
+# symlinks, as most OpenGL implementations have them, and they are
+# expected by some users such as libepoxy.
 define GCNANO_BINARIES_INSTALL
 	cd $(@D)/$(GCNANO_BINARIES_USERLAND_SUBDIR)/release/drivers/ ; \
 	find . -type f -exec $(INSTALL) -D -m 0755 {} $(1)/usr/lib/{} \; ; \
 	find . -type l -exec cp -a {} $(1)/usr/lib \;
+	ln -sf libGLESv2.so $(1)/usr/lib/libGLESv2.so.2
+	ln -sf libGLESv1_CM.so $(1)/usr/lib/libGLESv1_CM.so.1
 	mkdir -p $(1)/usr/include
 	cp -a $(@D)/$(GCNANO_BINARIES_USERLAND_SUBDIR)/release/include/* $(1)/usr/include/
 	ln -sf gbm/gbm.h $(1)/usr/include/gbm.h
Signature · 6 lines
2.37.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw

PATCH 2/2 package/gcnano-binaries: set Version: field in .pc files

All .pc files have a Version field set to #VERSION#, which needs to be replaced, otherwise packages checking the version of OpenGL ES, EGL, GBM, etc. will fail. For example:

Dependency gbm found: NO unknown version, but need: ['>=17.1.0']

Such problems have been seen with both libepoxy and SDL2.

The version 21.1.1 is chosen because it matches what the Yocto recipe is doing for this package:

https://github.com/STMicroelectronics/meta-st-stm32mp/blob/kirkstone/recipes-graphics/gcnano-userland/gcnano-userland.inc#L42

---
 package/gcnano-binaries/gcnano-binaries.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/gcnano-binaries/gcnano-binaries.mk +1 -1
index ce9b24cc3a..d9c47bf64e 100644
@@ -60,7 +60,7 @@ define GCNANO_BINARIES_INSTALL
 	ln -sf gbm/gbm.h $(1)/usr/include/gbm.h
 	cd $(@D)/$(GCNANO_BINARIES_USERLAND_SUBDIR)/pkgconfig/ ; \
 	for file in *.pc ; do \
-		sed -e "s|#PREFIX#|/usr|" $$file > $$file.temp ; \
+		sed -e "s|#PREFIX#|/usr|" -e "s|#VERSION#|21.1.1|" $$file > $$file.temp ; \
 		$(INSTALL) -D -m 0644 $$file.temp $(1)/usr/lib/pkgconfig/$$file ; \
 	done
 endef
Signature · 6 lines
2.37.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#2 lore raw

Re: [Buildroot] [PATCH 2/2] package/gcnano-binaries: set Version: field in .pc files

Thomas, All,

On 2022-08-04 22:41 +0200, Thomas Petazzoni via buildroot spake thusly:

Quoted 4 lines

All .pc files have a Version field set to #VERSION#, which needs to be replaced, otherwise packages checking the version of OpenGL ES, EGL, GBM, etc. will fail. For example:

Quoted 8 lines

Dependency gbm found: NO unknown version, but need: ['>=17.1.0']

Such problems have been seen with both libepoxy and SDL2.

The version 21.1.1 is chosen because it matches what the Yocto recipe is doing for this package:

https://github.com/STMicroelectronics/meta-st-stm32mp/blob/kirkstone/recipes-graphics/gcnano-userland/gcnano-userland.inc#L42

... which they did not provide any explanation for...

Quoted 1 line

Applied to master, thanks.

Regards,
Yann E. MORIN.

Quoted 24 lines
---
 package/gcnano-binaries/gcnano-binaries.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/gcnano-binaries/gcnano-binaries.mk +1 -1
index ce9b24cc3a..d9c47bf64e 100644
@@ -60,7 +60,7 @@ define GCNANO_BINARIES_INSTALL
 	ln -sf gbm/gbm.h $(1)/usr/include/gbm.h
 	cd $(@D)/$(GCNANO_BINARIES_USERLAND_SUBDIR)/pkgconfig/ ; \
 	for file in *.pc ; do \
-		sed -e "s|#PREFIX#|/usr|" $$file > $$file.temp ; \
+		sed -e "s|#PREFIX#|/usr|" -e "s|#VERSION#|21.1.1|" $$file > $$file.temp ; \
 		$(INSTALL) -D -m 0644 $$file.temp $(1)/usr/lib/pkgconfig/$$file ; \
 	done
 endef
Signature · 6 lines
2.37.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Signature · 10 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#3 lore raw

Re: [Buildroot] [PATCH 2/2] package/gcnano-binaries: set Version: field in .pc files

Quoted 6 lines · On Fri, 5 Aug 2022 18:35:34 +0200 "Yann E. MORIN" <[email protected]>…
Quoted 4 lines

The version 21.1.1 is chosen because it matches what the Yocto recipe is doing for this package:

https://github.com/STMicroelectronics/meta-st-stm32mp/blob/kirkstone/recipes-graphics/gcnano-userland/gcnano-userland.inc#L42

... which they did not provide any explanation for...

It matches a somewhat corresponding mesa3d version, I suppose. This is at least how some packages detect if libgbm is recent enough for their needs (I've seen a package require >= 17 for example).

Thomas

Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#4 lore raw
In reply to Thomas Petazzoni via buildroot

Thomas, All,

On 2022-08-04 22:41 +0200, Thomas Petazzoni via buildroot spake thusly:

Quoted 7 lines

At least libepoxy, a user of OpenGL ES, expects libraries to be available as libGLESv2.so.2 and libGLESv1_CM.so.1. While other OpenGL implementations comply with this, gcnano-binaries does not, and installs its libraries directly as .so, without any ABI version, causing runtime failures with libepoxy or SDL2, as it tries to dlopen() the OpenGL ES libraries with their ABI suffix.

Quoted 7 lines

See for example the libepoxy code:

https://github.com/anholt/libepoxy/blob/master/src/dispatch_common.c#L191

Fix this issue by adding the relevant symlinks.

Applied to master, thanks.

(this is a bit of a convoluted install command, if any...)

Regards,
Yann E. MORIN.

Quoted 33 lines
---
 package/gcnano-binaries/gcnano-binaries.mk | 7 +++++++
 1 file changed, 7 insertions(+)
package/gcnano-binaries/gcnano-binaries.mk +7 -0
index dc309ec3c2..ce9b24cc3a 100644
@@ -44,10 +44,17 @@ GCNANO_BINARIES_MODULE_MAKE_OPTS = \
 
 GCNANO_BINARIES_USERLAND_SUBDIR = gcnano-userland-multi-$(GCNANO_BINARIES_USERLAND_VERSION)
 
+# This creates:
+#   libGLESv2.so.2    -> libGLESv2.so
+#   libGLESv1_CM.so.1 -> libGLESv1_CM.so
+# symlinks, as most OpenGL implementations have them, and they are
+# expected by some users such as libepoxy.
 define GCNANO_BINARIES_INSTALL
 	cd $(@D)/$(GCNANO_BINARIES_USERLAND_SUBDIR)/release/drivers/ ; \
 	find . -type f -exec $(INSTALL) -D -m 0755 {} $(1)/usr/lib/{} \; ; \
 	find . -type l -exec cp -a {} $(1)/usr/lib \;
+	ln -sf libGLESv2.so $(1)/usr/lib/libGLESv2.so.2
+	ln -sf libGLESv1_CM.so $(1)/usr/lib/libGLESv1_CM.so.1
 	mkdir -p $(1)/usr/include
 	cp -a $(@D)/$(GCNANO_BINARIES_USERLAND_SUBDIR)/release/include/* $(1)/usr/include/
 	ln -sf gbm/gbm.h $(1)/usr/include/gbm.h
Signature · 6 lines
2.37.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Signature · 10 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot