Bug 212166 - graphics/opencsg links to qt4
Summary: graphics/opencsg links to qt4
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Some People
Assignee: Michael Reifenberger
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-08-26 02:18 UTC by don bright
Modified: 2018-01-21 17:11 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (mr)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description don bright 2016-08-26 02:18:53 UTC
opencsg is linked to Qt4 libraries which can cause problems with programs using qt5. 

Specifically it links to /usr/local/lib/qt4/libQtGui.so.4 and libQtCore.so.4, which can cause a segfault if you build a program linking against both opencsg and qt5 


[root@freebsd-32gb-nyc3-01 /usr/local/lib]# ldd libopencsg.so
libopencsg.so:
	libGL.so.1 => /usr/local/lib/libGL.so.1 (0x80161d000)
	libQtGui.so.4 => /usr/local/lib/qt4/libQtGui.so.4 (0x801a00000)
	libQtCore.so.4 => /usr/local/lib/qt4/libQtCore.so.4 (0x802800000)
 . . . . 


To reproduce:

build a program that links to both opencsg and qt5

Possible solution:

hack the opencsg build system so it doesnt link to qt. the library doesn't actually use QT in any of it's code so there is no need to link. 

For example the link line of the make goes like this:


donb@gcc1-power7:~/openscad_deps/src/OpenCSG-1.3.2/src$ make VERBOSE=1
...
g++ -m64 -Wl,-O1 -Wl,-rpath,/opt/cfarm/qt5.5.1/lib -shared -Wl,-soname,libopencsg.so.1 -o libopencsg.so.1.3.2 area.o batch.o context.o channelManager.o frameBufferObject.o frameBufferObjectExt.o occlusionQuery.o offscreenBuffer.o opencsgRender.o openglHelper.o pBufferTexture.o primitive.o primitiveHelper.o renderGoldfeather.o renderSCS.o scissorMemo.o settings.o stencilManager.o RenderTexture.o  -L/usr/X11R6/lib64 -lGL -L/opt/cfarm/qt5.5.1/lib -lQt5Gui -lQt5Core -lpthread 

if you remove the QT stuff, like this, it works fine:

donb@gcc1-power7:~/openscad_deps/src/OpenCSG-1.3.2/src$ g++ -m64 -Wl,-O1 -Wl,-rpath,/opt/cfarm/qt5.5.1/lib -shared -Wl,-soname,libopencsg.so.1 -o libopencsg.so.1.3.2 area.o batch.o context.o channelManager.o frameBufferObject.o frameBufferObjectExt.o occlusionQuery.o offscreenBuffer.o opencsgRender.o openglHelper.o pBufferTexture.o primitive.o primitiveHelper.o renderGoldfeather.o renderSCS.o scissorMemo.o settings.o stencilManager.o RenderTexture.o  -L/usr/X11R6/lib64 -lGL -lpthread
Comment 1 Walter Schwarzenfeld freebsd_triage 2018-01-13 22:53:20 UTC
Maintainer feedback?
Comment 2 commit-hook freebsd_committer 2018-01-21 16:59:37 UTC
A commit references this bug:

Author: mr
Date: Sun Jan 21 16:58:32 UTC 2018
New revision: 459619
URL: https://svnweb.freebsd.org/changeset/ports/459619

Log:
  Try to simplify the Makefile and avoid linking to the unneeded qt libs.

  PR:		212166

Changes:
  head/graphics/opencsg/Makefile
Comment 3 Michael Reifenberger freebsd_committer 2018-01-21 17:11:30 UTC
Hi,
should be fixed now.

Please test.

Greetings
---
Michael Reifenberger