FLTK logo

Re: [fltk.general] -no-pie in FLTK Libraries build.

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.general  ]
 
Previous Message ]New Message | Reply ]Next Message ]

Re: -no-pie in FLTK Libraries build. "'Albrecht Schlosser' via fltk.general" 06:44 Mar 21  
  On 3/18/24 05:53 Rob McDonald wrote:
On Sunday, March 17, 2024 at 3:09:57 PM UTC-7 Albrecht-S wrote:
Very likely, I see pretty much chaos and inconsistent code in this area.  :-(

I started working on this but it will take some time - definitely not today.

No worries.  I have my workarounds and am happy to be patient to remove them once it gets settled.  It looks like this may be the tip of a larger iceberg in certain ways.

Done in commit b53b2b6e1182efaf532d6eb9377a321e6e13a7e4.

I removed the "-no-pie" build option altogether.

For now I have a short request to test: can you please comment out (or delete) the 3 lines of code in src/CMakeLists.txt that set the '-no-pie' flag in the FLTK code and try again w/o the assignment?

767 if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux" AND NOT FLTK_BUILD_SHARED_LIBS) 768 list(APPEND OPTIONAL_LIBS "-no-pie") 769 endif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux" AND NOT FLTK_BUILD_SHARED_LIBS)

Removing these lines works exactly as you would expect.  Everything else is the same, the '-no-pie' does not come through to my application, everything works.

Thanks for testing. That's what I did now in above mentioned commit.

Alternatively (or additionally) you could try changing the two lines that assign OPTIONAL_LIBS as PUBLIC to PRIVATE:
775 target_link_libraries(fltk PUBLIC ${OPTIONAL_LIBS}) 831 target_link_libraries(fltk-shared PUBLIC ${OPTIONAL_LIBS}) s/PUBLIC/PRIVATE/

I made this change as well, when I did so, the INTERFACE_LINK_LIBRARIES target property changed from:

/usr/lib64/libdl.a/usr/lib64/libX11.so/usr/lib64/libXext.so/usr/lib64/libXinerama.so/usr/lib64/libXfixes.so/usr/lib64/libXcursor.so/usr/lib64/libXrender.so/usr/lib64/libpango-1.0.so/usr/lib64/libpangocairo-1.0.so/usr/lib64/libcairo.so/usr/lib64/libgobject-2.0.so/usr/lib64/libpangoxft-1.0.so/usr/lib64/libXft.so/usr/lib64/libfontconfig.so-lwayland-egl -lEGL-L/usr/lib64-lgtk-3-lgdk-3-lpangocairo-1.0-lpango-1.0-lharfbuzz-latk-1.0-lcairo-gobject-lcairo-lgdk_pixbuf-2.0-lgio-2.0-lgobject-2.0-lglib-2.0-lwayland-cursor -lwayland-client -lxkbcommon -ldl-L/usr/lib64-ldbus-1-no-pie

To:

/usr/lib64/libdl.a/usr/lib64/libX11.so/usr/lib64/libXext.so/usr/lib64/libXinerama.so/usr/lib64/libXfixes.so/usr/lib64/libXcursor.so/usr/lib64/libXrender.so/usr/lib64/libpango-1.0.so/usr/lib64/libpangocairo-1.0.so/usr/lib64/libcairo.so/usr/lib64/libgobject-2.0.so/usr/lib64/libpangoxft-1.0.so/usr/lib64/libXft.so/usr/lib64/libfontconfig.so-lwayland-egl -lEGL-L/usr/lib64$<LINK_ONLY:-lgtk-3>$<LINK_ONLY:-lgdk-3>$<LINK_ONLY:-lpangocairo-1.0>$<LINK_ONLY:-lpango-1.0>$<LINK_ONLY:-lharfbuzz>$<LINK_ONLY:-latk-1.0>$<LINK_ONLY:-lcairo-gobject>$<LINK_ONLY:-lcairo>$<LINK_ONLY:-lgdk_pixbuf-2.0>$<LINK_ONLY:-lgio-2.0>$<LINK_ONLY:-lgobject-2.0>$<LINK_ONLY:-lglib-2.0>-lwayland-cursor -lwayland-client -lxkbcommon -ldl-L/usr/lib64$<LINK_ONLY:-ldbus-1>

Of course the '-no-pie' is gone from removing the first lines.

However, the change from PUBLIC to PRIVATE added the $<LINK_ONLY:foo> wrapper around a bunch of the list items.  This still worked in the end, but I am not sure if this is what is expected / intended.

Adding the $<LINK_ONLY:...> generator _expression_ is exactly what CMake does for PRIVATE link dependencies (INTERFACE_LINK_LIBRARIES).

This is a distinction that is needed for the new "Modern CMake" approach but it was irrelevant in previous (FLTK/CMake build file) versions. What I still need to figure out is which ones of the target_link_libraries() need to be PUBLIC and which ones can - or better: should -  be PRIVATE.

For fun, I restored the first three lines, but kept the change to PRIVATE.  The result of this is as follows:

[...]

So, the change to PRIVATE does not keep the -no-pie from coming through.

Expected.

The subsequent build failed.  So, the PRIVATE marker is not having the effect I would have expected it to.

Yes, it's CMake "magic". The details are often confusing and hard to understand.
 
PS: I'm also investigating an option like "DISABLE_GLU" to solve your other issue but I'll reply to the other thread tomorrow.

Still working on this one. I'm researching some ideas...

Thanks for all the help,

Welcome.

--
You received this message because you are subscribed to the Google Groups "fltk.general" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fltkgeneral+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkgeneral/ed34cc4b-eadc-41f0-b990-6ee7727f2a2e%40aljus.de.
Direct Link to Message ]
 
     
Previous Message ]New Message | Reply ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.