diff options
Diffstat (limited to 'media-libs/freeglut')
-rw-r--r-- | media-libs/freeglut/Manifest | 3 | ||||
-rw-r--r-- | media-libs/freeglut/files/freeglut-3.2.1-gcc10-fno-common.patch | 81 | ||||
-rw-r--r-- | media-libs/freeglut/freeglut-3.2.1.ebuild | 1 |
3 files changed, 84 insertions, 1 deletions
diff --git a/media-libs/freeglut/Manifest b/media-libs/freeglut/Manifest index 9c0fa2f7e3d3..29d1fb82a8e3 100644 --- a/media-libs/freeglut/Manifest +++ b/media-libs/freeglut/Manifest @@ -1,3 +1,4 @@ +AUX freeglut-3.2.1-gcc10-fno-common.patch 3500 BLAKE2B 7163acef56f8f1bfebeaed554ecbe7a27dc3321bd19f5da5c1f482f52a447acf7bff3b8358d8023d8552fa5fa999475b70e3ec7242e8a127000ee7b49f2f751b SHA512 0845bc4c91c6233cab8c56d15d1efa8fcdac7ae12270a089f8dd20520fc5c94078b7abceadef304f8f42cd575a61ad5b1f444f21e0bbdd3ff310bcc40192336b DIST freeglut-3.2.1.tar.gz 440228 BLAKE2B ed8a4b2361416cfee5540350ee50c32a56e5ea75d6834c677c5cec676967a04e13b2adf3da1cc9a3a2c73fbc6147b3b0bc91953a6edf1e35ce8c933eeff6f97a SHA512 aced4bbcd36269ce6f4ee1982e0f9e3fffbf18c94f785d3215ac9f4809b992e166c7ada496ed6174e13d77c0f7ef3ca4c57d8a282e96cbbe6ff086339ade3b08 -EBUILD freeglut-3.2.1.ebuild 1373 BLAKE2B 98d21dfb81cbdb733fe62c9025c6d4bc51ddd671ba96b384469755c2e589ee3874adecc3a7e73399ce6981c7281be9f457425d3e9f5e8000b83df38a80f832ba SHA512 064fc266920044ed4b854ec7e948c4c93cfbdf45df3151828c227788318ced1279f5572f1551d2ad81947a00a4893f352e4c3f847c7cf51d9b79909559fe695b +EBUILD freeglut-3.2.1.ebuild 1434 BLAKE2B 384883c33216f15a5405dc5118fb84c39db768526837a1242e24818a57ccea813167998bf1b8c5267373c3a7506640c7618575c32c53b785a27ffb4529a3dfe8 SHA512 1744626450f59494087145f17594e1fa999deb229a2990d7150ad807ff4c0a7f31e88fd97cd444c0905ba436f00b5735664776f42d3816aad8eb0b21f3c9d07a MISC metadata.xml 528 BLAKE2B ee8c09e46677ec77c1d6771b31ac1b28e75464d7e0e4405c41831e19446c5a442c782dbd32a79d0fe5e7ed85ecbd2404764f2121f5f4bff5483db4571fd89212 SHA512 94dc412f8f049bb88723fdba9f9b89645eb792547a768ea524a711ad9302c5cac38a7292ab09726154fc6829a05f41af05220f91d9f6eaed056e4cff8324370e diff --git a/media-libs/freeglut/files/freeglut-3.2.1-gcc10-fno-common.patch b/media-libs/freeglut/files/freeglut-3.2.1-gcc10-fno-common.patch new file mode 100644 index 000000000000..655c01bf94b4 --- /dev/null +++ b/media-libs/freeglut/files/freeglut-3.2.1-gcc10-fno-common.patch @@ -0,0 +1,81 @@ +From 5791564dd934d193df771a0a7c52013e9f456aa1 Mon Sep 17 00:00:00 2001 +From: Sergei Trofimovich <slyfox@gentoo.org> +Date: Tue, 21 Jan 2020 22:33:49 +0000 +Subject: [PATCH] fg_gl2: fix build failure against gcc-10 + +On gcc-10 (and gcc-9 -fno-common) build fails as: + +``` +[ 31%] Linking C executable bin/Lorenz_static +/usr/bin/cmake -E cmake_link_script CMakeFiles/Lorenz_static.dir/link.txt --verbose=1 +/usr/lib/ccache/bin/cc -Wall -pedantic -rdynamic CMakeFiles/Lorenz_static.dir/progs/demos/Lorenz/lorenz.c.o \ + -o bin/Lorenz_static -lGLU -lGL -lm -lX11 -lXrandr -lXxf86vm -lXi -lm lib/libglut.a -lGL -lm -lX11 -lXrandr -lXxf86vm -lXi +ld: lib/libglut.a(fg_gl2.c.o):(.bss+0x0): + multiple definition of `fghGenBuffers'; lib/libglut.a(fg_window.c.o):(.bss+0x0): first defined here +ld: lib/libglut.a(fg_gl2.c.o):(.bss+0x8): + multiple definition of `fghDeleteBuffers'; lib/libglut.a(fg_window.c.o):(.bss+0x8): first defined here +``` + +Note: duplicate definition comes here from 'fg_gl2.h'. +The fix is to move declaration to a 'fg_gl2.c' file. + +gcc-10 will change the default from -fcommon to fno-common: +https://gcc.gnu.org/PR85678. + +The error also happens if CFLAGS=-fno-common passed explicitly. + +Bug: https://bugs.gentoo.org/705840 +Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org> +--- + src/fg_gl2.c | 12 ++++++++++++ + src/fg_gl2.h | 14 +++++++------- + 2 files changed, 19 insertions(+), 7 deletions(-) + +diff --git a/freeglut/freeglut/src/fg_gl2.c b/freeglut/freeglut/src/fg_gl2.c +index 38b0acbb..f79c432a 100644 +--- a/src/fg_gl2.c ++++ b/src/fg_gl2.c +@@ -27,6 +27,18 @@ + #include "fg_internal.h" + #include "fg_gl2.h" + ++#ifdef GL_ES_VERSION_2_0 ++/* Use existing functions on GLES 2.0 */ ++#else ++FGH_PFNGLGENBUFFERSPROC fghGenBuffers; ++FGH_PFNGLDELETEBUFFERSPROC fghDeleteBuffers; ++FGH_PFNGLBINDBUFFERPROC fghBindBuffer; ++FGH_PFNGLBUFFERDATAPROC fghBufferData; ++FGH_PFNGLENABLEVERTEXATTRIBARRAYPROC fghEnableVertexAttribArray; ++FGH_PFNGLDISABLEVERTEXATTRIBARRAYPROC fghDisableVertexAttribArray; ++FGH_PFNGLVERTEXATTRIBPOINTERPROC fghVertexAttribPointer; ++#endif ++ + void FGAPIENTRY glutSetVertexAttribCoord3(GLint attrib) { + if (fgStructure.CurrentWindow != NULL) + fgStructure.CurrentWindow->Window.attribute_v_coord = attrib; +diff --git a/freeglut/freeglut/src/fg_gl2.h b/freeglut/freeglut/src/fg_gl2.h +index ab8ba5c7..fb3d4676 100644 +--- a/src/fg_gl2.h ++++ b/src/fg_gl2.h +@@ -67,13 +67,13 @@ typedef void (APIENTRY *FGH_PFNGLENABLEVERTEXATTRIBARRAYPROC) (GLuint index); + typedef void (APIENTRY *FGH_PFNGLDISABLEVERTEXATTRIBARRAYPROC) (GLuint); + typedef void (APIENTRY *FGH_PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer); + +-FGH_PFNGLGENBUFFERSPROC fghGenBuffers; +-FGH_PFNGLDELETEBUFFERSPROC fghDeleteBuffers; +-FGH_PFNGLBINDBUFFERPROC fghBindBuffer; +-FGH_PFNGLBUFFERDATAPROC fghBufferData; +-FGH_PFNGLENABLEVERTEXATTRIBARRAYPROC fghEnableVertexAttribArray; +-FGH_PFNGLDISABLEVERTEXATTRIBARRAYPROC fghDisableVertexAttribArray; +-FGH_PFNGLVERTEXATTRIBPOINTERPROC fghVertexAttribPointer; ++extern FGH_PFNGLGENBUFFERSPROC fghGenBuffers; ++extern FGH_PFNGLDELETEBUFFERSPROC fghDeleteBuffers; ++extern FGH_PFNGLBINDBUFFERPROC fghBindBuffer; ++extern FGH_PFNGLBUFFERDATAPROC fghBufferData; ++extern FGH_PFNGLENABLEVERTEXATTRIBARRAYPROC fghEnableVertexAttribArray; ++extern FGH_PFNGLDISABLEVERTEXATTRIBARRAYPROC fghDisableVertexAttribArray; ++extern FGH_PFNGLVERTEXATTRIBPOINTERPROC fghVertexAttribPointer; + + # endif + diff --git a/media-libs/freeglut/freeglut-3.2.1.ebuild b/media-libs/freeglut/freeglut-3.2.1.ebuild index 5efa6e624137..dec72e4fdd67 100644 --- a/media-libs/freeglut/freeglut-3.2.1.ebuild +++ b/media-libs/freeglut/freeglut-3.2.1.ebuild @@ -27,6 +27,7 @@ DEPEND="${RDEPEND} x11-base/xorg-proto" BDEPEND="virtual/pkgconfig" +PATCHES=( "${FILESDIR}"/${PN}-3.2.1-gcc10-fno-common.patch ) HTML_DOCS=( doc/. ) src_configure() { |