Linking error on PPA for Ubuntu Cosmic 18.10; GLVND

Bug #1772079 reported by kaputtnik on 2018-05-18
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
widelands
Undecided
Unassigned

Bug Description

Ubuntu 18.10 comes with GCC 8.2.0 as default compiler which cause linking errors regarding OPEN_GL:

/usr/bin/ld: ../../graphic/libgraphic_draw_programs.a(fill_rect_program.cc.o): undefined reference to symbol 'glEnable'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/libGL.so: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status

Related branches

kaputtnik (franku) on 2018-05-18
summary: - CMake 3.10: warning about FindOpenGL
+ CMake 3.11: warning about FindOpenGL
GunChleoc (gunchleoc) on 2018-05-22
tags: added: buildsystem graphics
Changed in widelands:
milestone: none → build21-rc1
GunChleoc (gunchleoc) on 2018-10-04
Changed in widelands:
milestone: build21-rc1 → build20-rc1

Before this policy can be set to NEW it should be investigated whether Widelands can be compiled on Linux using the GLVND-libs. It seems not possible ATM:

https://code.launchpad.net/~widelands-dev/widelands/cmakepolicy/+merge/356018/comments/926483

GunChleoc (gunchleoc) on 2018-10-11
Changed in widelands:
status: New → In Progress
assignee: nobody → Toni Förster (stonerl)
GunChleoc (gunchleoc) on 2018-10-14
Changed in widelands:
status: In Progress → Fix Committed
assignee: Toni Förster (stonerl) → nobody
GunChleoc (gunchleoc) wrote :

This still fails in the daily PPA for Ubuntu 18.10:

/usr/bin/ld: ../../graphic/libgraphic_draw_programs.a(fill_rect_program.cc.o): undefined reference to symbol 'glEnable'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/libGL.so: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status

Example log:

https://launchpadlibrarian.net/393322398/buildlog_ubuntu-cosmic-amd64.widelands_1%3A19-ppa0-bzr8888-201810150529~ubuntu18.10.1_BUILDING.txt.gz

Changed in widelands:
status: Fix Committed → Confirmed
Toni Förster (stonerl) wrote :

I think it is better to continue here instead of the already merged proposal.

Ubuntu 18.10 comes with GCC 8.2.0 as default compiler.

I tested on Ubuntu 18.10 with GCC 8.2.0 and ran into the same issue. Using Clang 7 on the other hand worked like a charm.

kaputtnik tested the changes on his ArchLinux-box with GCC 8.2.1 and had no issues whatsoever.

I currently testing with GCC 7.3.0, but this might take some time.

Toni Förster (stonerl) wrote :

Same problem with gcc 7.

Toni Förster (stonerl) wrote :

I don't get it.

https://launchpadlibrarian.net/393526226/buildlog_ubuntu-cosmic-amd64.widelands_1%3A19-ppa0-bzr8890-201810161048~ubuntu18.10.1_BUILDING.txt.gz

-- Adding linker flags for GLVND.

When I test r8890 in my 18.10 virtual machine it does not set the flag, because it detects Ubuntu 18.10 proberly and sets CMP0072 to OLD. This apparently does not happen on the build server....

---

But I think I found the cause for the linker errors: It detects the following lib:

-- Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so

but later on it wants to use this one for linking: /usr/lib//x86_64-linux-gnu/libGL.so

/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/libGL.so: error adding symbols: DSO missing from command line

oO

The GNU linker is somewhat weird... I have a similar issue on macOS when using GCC 7. There it links the wrong ASAN-libraries.

kaputtnik (franku) wrote :

Create a branch which has all needed variables printed out and see what values are produced on the build server?

Maybe it is easier to have a compile option USE_GLVND which defaults to OFF?

Toni Förster (stonerl) wrote :

The problem is that "lsb_release" is not available on the build-server... for some reason. That's why it works in my VM, but not on the build-server.

I do have another idea, though.

GunChleoc (gunchleoc) wrote :

You could set up your own PPA on the branch, there is a button in the branch view. Copy over the code from trunk and you should be able to request builds manually for testing.

kaputtnik (franku) on 2018-10-17
summary: - CMake 3.11: warning about FindOpenGL
+ Linking error on PPA for Ubuntu Cosmic 18.10; GLVND
description: updated
GunChleoc (gunchleoc) wrote :

Tadaa!

Thanks :)

Changed in widelands:
status: Confirmed → Fix Committed
GunChleoc (gunchleoc) wrote :

Fixed in build20-rc1

Changed in widelands:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers