Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Premake5 #1265

Closed
Carluccio opened this issue Apr 5, 2019 · 11 comments · Fixed by #1396
Closed

Premake5 #1265

Carluccio opened this issue Apr 5, 2019 · 11 comments · Fixed by #1396

Comments

@Carluccio
Copy link

Carluccio commented Apr 5, 2019

Sorry, I'm a beginner. How to put in LIBS + = -Wl, -- start-group ... -Wl, -- end-group?
What instructions in premake5.lua?

@samsinsane
Copy link
Member

You can achieve this using linkgroups.

@Carluccio
Copy link
Author

Sorry, but I had abandoned the idea. Now I resume and reopen the topic.
I tried this:
linkgroups "ON"
links {"lib1", "lib2", "lib3", ....}
but it does not work!
Where and how should I put linkgroups?
(I'm a beginner and I use premake5 alpha 14)
regards
Carlo Sala

@samsinsane samsinsane reopened this Jun 7, 2019
@samsinsane
Copy link
Member

That's the correct way, what action are you using? I assume gmake2?

@Carluccio
Copy link
Author

I use gmake because gmake2 does not read rc files !! (another fault found)
In any case, linkgroups does not work in both cases
regards
Carlo Sala

@Carluccio
Copy link
Author

in gmake2 the rc file is read before the others ... in my case it needs to be read last so that my little program works.
However in this case I will be able to make changes.
regards
Carlo Sala

@Carluccio
Copy link
Author

I have to add another anomaly found:
with Mingw64 targetname does not work; with TDM-GCC instead, it works.
Regards
Carlo Sala

@samsinsane
Copy link
Member

Let's keep this issue focused on your original issue. If you can open new issues for the others instead that would be great, otherwise they're just going to get lost and not fixed.

Are lib1, lib2, etc all Premake projects or are they external dependencies? I'm not sure if Premake wraps all links in the link group options, I'm not sure why not though.

@Carluccio
Copy link
Author

Lib1, lib2, etc. they are wxWidgets libraries, so they are libraries located in the wxWidgets folder.
However, I read the generated .make file and in the "LIBS + =" there are these libraries but they are missing at the beginning: -Wl, - start-group and at the end of the list: -WL, - end-group, as instead I should have expected.
regards
Carlo Sala

@samsinsane
Copy link
Member

Right, I don't believe linkoptions wraps all libraries just the Premake ones - this should be fixed.

The issue is that the below assumes that everything else is a system library when some will be precompiled libs. Moving the start/end group lines to below the bottom is probably the best solution.

if not nogroups and #result > 1 and (cfg.linkgroups == p.ON) then
table.insert(result, 1, "-Wl,--start-group")
table.insert(result, "-Wl,--end-group")
end
-- The "-l" flag is fine for system libraries

@Carluccio
Copy link
Author

Yes, I understood the problem, but the inconsistent list order concerns, in my case, only that of the wxWidgets static libraries.
I had however solved by changing the order of listing, and I had found the right one thus solving the problem.
In any case it would have been nice to have "linkgroups" working for these too.
regards
Carlo Sala

@samsinsane
Copy link
Member

In any case it would have been nice to have "linkgroups" working for these too.

Agreed, that's why I've added the information above, so that if I can't get to it then someone else can move those four lines down the function and ensure that all libraries are within the link group ordering.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants