Giter VIP home page Giter VIP logo

Comments (5)

amkozlov avatar amkozlov commented on August 23, 2024

There is a problem with clang version detection here:
https://github.com/xflouris/libpll/blob/master/src/hardware.c#L26

due to the fact that there seems to be two parallel version numbering schemes...

E.g. on apple-sco, we have:

$ clang -v
Apple LLVM version 8.0.0 (clang-800.0.42.1)
Target: x86_64-apple-darwin16.5.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

$ echo | clang -dM -E - | grep clang
#define __VERSION__ "4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1)"
#define __clang__ 1
#define __clang_major__ 8
#define __clang_minor__ 0
#define __clang_patchlevel__ 0
#define __clang_version__ "8.0.0 (clang-800.0.42.1)"

Presumably, one shouldn't rely on those predatory version numbers but use __has_builtin instead:

https://stackoverflow.com/questions/1617877/how-to-detect-llvm-and-its-version-through-define-directives

but ironically, this doesn't work for __builtin_cpu_supports

https://bugs.llvm.org//show_bug.cgi?id=25510

So I'm afraid the only workaround here would be to have additional checks for __clang_major__ 7 and 8 and corresponding __clang_minor__...

from libpll.

xflouris avatar xflouris commented on August 23, 2024

@amkozlov : if I understand correctly, the preprocessor check for line 26 fails (i.e. clang version > 3.9.x) and as such, it attempts to use __builtin_cpu_supports which also fails for this particular version of clang?

from libpll.

amkozlov avatar amkozlov commented on August 23, 2024

@xflouris: exactly.

And to add to the confusion, LLVM is now changing the versioning scheme:
http://blog.llvm.org/2016/12/llvms-new-versioning-scheme.html

so if I get it right, in just a couple of years we will have LLVM/clang v8.0.0 which is not the same as v8.0.0 we have right now.

from libpll.

xflouris avatar xflouris commented on August 23, 2024

great :-( Maybe an easier solution would be to check for APPLE and force assembly code on it, instead of checking additional clang versions?
I think Linux uses clang 3-4 (but I'm not really sure).

from libpll.

amkozlov avatar amkozlov commented on August 23, 2024

yes, probably that's the easiest solution

from libpll.

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.