Giter Site home page Giter Site logo

Comments (7)

starkos avatar starkos commented on July 22, 2024

Did you set toolset "clang"?

from premake-core.

fzwoch avatar fzwoch commented on July 22, 2024

This is the old issue with Apple's linker described here:
https://bitbucket.org/premake/premake-dev/issue/263/os-x-gcc-clang-and-the-infamous-wl-x

As mentioned there the only workaround at this time is to remove "-x" (this is exclusive to system == macosx, right?) altogether but instead issue a "strip -x" on the final binary.

I wanted to write a patch for it but couldn't figure out how to handle it in the code :/

For the record - I issued a bug report to Apple on this issue back in March 2015. It did not get any attention up to this date. So I guess it is safe to assume it is not getting fixed unless accidentally or upstream by LLVM if it is their bug at all.

from premake-core.

starkos avatar starkos commented on July 22, 2024

Looking at the code, it appears we've already removed that flag for Clang though? We don't emit a strip -x yet, and we should (so let's keep this ticket open) but you shouldn't be getting a -Wl,-x if you've set the toolset to Clang. And if you are it would be good to know how that's happening so we can fix it!

from premake-core.

fzwoch avatar fzwoch commented on July 22, 2024

Confirmed that 'toolset "clang"' is working fine - ignoring the fact it does not strip. I didn't come across the "toolset" option before. I assumed that "--cc=clang" on the command line would do this for me.

from premake-core.

starkos avatar starkos commented on July 22, 2024

I assumed that "--cc=clang" on the command line would do this for me.

Yes, that should have been equivalent, you're right. Would be good to know what went wrong there? I haven't looked at that bit of code in quite a while.

from premake-core.

fzwoch avatar fzwoch commented on July 22, 2024

I was not confident enough to actually create a pull request for this.. I think this might remedy the issue that --cc=clang was not set correctly picked up for the gmake target.

This was merely copied from the codelite module. Not sure if this is okay or should be fixed differently. This not being handled globally could mean every other module could easily fail here as well.

diff --git a/src/actions/make/make_cpp.lua b/src/actions/make/make_cpp.lua
index 9b746c8..573b199 100644
--- a/src/actions/make/make_cpp.lua
+++ b/src/actions/make/make_cpp.lua
@@ -81,9 +81,9 @@
                        -- identify the toolset used by this configurations (would be nicer if
                        -- this were computed and stored with the configuration up front)

-                       local toolset = premake.tools[cfg.toolset or "gcc"]
+                       local toolset = premake.tools[_OPTIONS.cc or cfg.toolset or "gcc"]
                        if not toolset then
-                               error("Invalid toolset '" + cfg.toolset + "'")
+                               error("Invalid toolset '" + (_OPTIONS.cc or cfg.toolset) + "'")
                        end

                        _x('ifeq ($(config),%s)', cfg.shortname)

from premake-core.

starkos avatar starkos commented on July 22, 2024

It would be better if we could handle this in one place, and give the exporters a function they can call to get the correct value. Thinking off the top of my head:

---
-- Return the correct toolset adapter for the given configuration.
--
-- @param cfg
--    The configuration to be tested.
-- @param default
--    An optional toolset identifier (i.e. "gcc") to select if no value is
--    provided by the configuration.
-- @param language
--    An optional language identifier (i.e. "C++") to override the language
--    that has been set in the configuration.
-- @return
--    A toolset adapter or nil
---
function config.toolset(cfg, default, language)
   -- get the tool ID (i.e. "cc" or "cxx") for the given language
   -- TODO: write this function; maps "C"->"cc", "C++"->"cxx", etc.
   local tool = p.tools.identifyTool(language or cfg.language)

   -- get the toolset ID (i.e. "gcc" or "clang") 
   local toolset = _OPTIONS[tool] or cfg.toolset or default

   if toolset then
      return p.tools[toolset]
   end
end

from premake-core.

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.