Giter VIP home page Giter VIP logo

Comments (11)

ibre5041 avatar ibre5041 commented on August 15, 2024

does it mean that the issue with qscintilla2 on gentoo was fixed?

from tora.

msva avatar msva commented on August 15, 2024

@ibre5041 yes, it is fixed (it is QScintilla[qt5] in the tree now)

from tora.

msva avatar msva commented on August 15, 2024

and, talking on topic of the issue, I am getting the same too, and have no idea about how to fix this... exporting -fPIC -DPIC to cflags doesn't help :(

from tora.

msva avatar msva commented on August 15, 2024

update: sed'ing -ggdb3 to -ggdb3 -fPIC in CMakeLists.txt fixed the problem.

// although, it will be nicer, if your buildsystem inherited system's C{,XX}FLAGS (that set in the environment)

from tora.

ibre5041 avatar ibre5041 commented on August 15, 2024

This is really turning into a nigtmare. I fixed it already several times. But I do not recall details.
It depends on cmake version. Some versions embed value of CMAKE_CXX_FLAGS_RELEASE in CMAKE_CXX_FLAGS - while others do not.

Some Qt versions set Qt5_POSITION_INDEPENDENT_CODE, therefore I tried to use CMAKE_POSITION_INDEPENDENT_CODE.

  # prevent error "You must build your code with position independent code if Qt was built with..
  #if (Qt5_POSITION_INDEPENDENT_CODE)
  #  SET(CMAKE_POSITION_INDEPENDENT_CODE ON)
  #endif()

But it was not supported on older cmake version. So I decided to use Qt5Widgets_EXECUTABLE_COMPILE_FLAGS. Theoretically this variable should contain flags, Qt was built with. Can you please check wheter your Qt installation sets this variable in .cmake files?

from tora.

ibre5041 avatar ibre5041 commented on August 15, 2024

So this:

  SET(CMAKE_CXX_FLAGS         "${CMAKE_CXX_FLAGS} ${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}")
  SET(CMAKE_C_FLAGS           "${CMAKE_C_FLAGS}   ${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}")
  STRING(TOUPPER "CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE}" _flags_var_name)
  SET(${_flags_var_name}      "${${_flags_var_name}} ${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}")
  SET("CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE}" _flags_var_name)

Should add the proper flags to the current build type.

from tora.

msva avatar msva commented on August 15, 2024

Not sure about Widgets one:

$ grep -r COMPILE_FL /usr/lib64/cmake/Qt5Widgets/
/usr/lib64/cmake/Qt5Widgets/Qt5WidgetsConfig.cmake:    set(Qt5Widgets_EXECUTABLE_COMPILE_FLAGS "")
/usr/lib64/cmake/Qt5Widgets/Qt5WidgetsConfig.cmake:        list(APPEND Qt5Widgets_EXECUTABLE_COMPILE_FLAGS ${Qt5${_module_dep}_EXECUTABLE_COMPILE_FLAGS})
/usr/lib64/cmake/Qt5Widgets/Qt5WidgetsConfig.cmake:    list(REMOVE_DUPLICATES Qt5Widgets_EXECUTABLE_COMPILE_FLAGS)

But Core one seems to do the right thing:

/usr/lib64/cmake/Qt5Core/Qt5CoreConfigExtras.cmake:    set(Qt5Core_EXECUTABLE_COMPILE_FLAGS "-fPIC")

from tora.

msva avatar msva commented on August 15, 2024

And, by the way, why don't you just add -fPIC as is by default to C{,XX}FLAGS unrelated to how Qt is built? :)

from tora.

ibre5041 avatar ibre5041 commented on August 15, 2024

because some distros need -fPIE and some other need even more flags. You should really use the same flags Qt was built with.

from tora.

ibre5041 avatar ibre5041 commented on August 15, 2024

Try it now.

from tora.

msva avatar msva commented on August 15, 2024

from tora.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.