Re: [cfe-users] Unexpected include directories when cross-compiling

2015-09-22 Thread Jeffrey Walton via cfe-users
> Another thing I noticed occurs when using the -sysroot option. clang then > tries to use $sysroot/usr/include. In my oppinion it should use > $sysroot/include instead. I could be wrong here, but --sysroot and --isysroot (with some hand waiving) means use /usr/include to find headers and /usr/lib

[cfe-users] Replacement for -fdevirtualize?

2015-10-25 Thread Jeffrey Walton via cfe-users
Hi Everyone, I'm catching a warning when trying to use -fdevirtualize under Clang. $ make /usr/local/bin/clang++ -DNDEBUG -g -O2 -fdevirtualize -march=native -c eax.cpp clang: warning: optimization flag '-fdevirtualize' is not supported ... I believe its equivalent to Microsoft's __decls

[cfe-users] Integrated assembler, -arch i386 and ILP32

2015-11-30 Thread Jeffrey Walton via cfe-users
Hi Everyone, We took a bug report on some line assembly code (https://github.com/weidai11/cryptopp/issues/72). I have two questions at the end on Clang, Apple and ILP32. The code performs the following: asm volatile ( // save ebx in case -fPIC is being used

Re: [cfe-users] Integrated assembler, -arch i386 and ILP32

2015-11-30 Thread Jeffrey Walton via cfe-users
> BOOL_X32 is set when __ILP32__ is defined. BOOL_X86 is defined when > __i386__ (and friends) is defined. BOOL_X64 is defined when __x86_64__ > (and friends) is defined. We set the conditions based on " System V > Application Binary Interface, AMD64 (With LP64 and ILP32 Programming > Models)", htt

[cfe-users] Integrated Assembler, JNZ and "unknown token in expression"

2015-12-24 Thread Jeffrey Walton via cfe-users
Hi Everyone, I'm catching a compile error with some inline assembly under Clang 3.4 provided by Ubuntu 14.04 LTS. The compile error is shown below (with macro expansion), but the essence is "JNZ 1b;" is producing "error: unknown token in expression". Any ideas how I can work around the issue? Th

[cfe-users] How to enable Initialization Order Fiasco sanitizer from the command line?

2016-01-11 Thread Jeffrey Walton via cfe-users
Hi Everyone, We have a C++ library and a test script that grinds though various configurations. It include various sanitizers. The script is a security gate, and the self tests must pass for a release. I want to add the Initialization Order Fiasco sanitizer as a command line option, and not a env

[cfe-users] Does Integrated Assembler need Output Operands listed as Clobbered?

2016-01-29 Thread Jeffrey Walton via cfe-users
We have a user reporting a crash under Apple's Clang 7.0.2. The code is: __asm__ volatile( #if BOOL_X64 || BOOL_X32 ".byte 0x48, 0x0f, 0xc7, 0xf0;\n" // rdrand rax #else ".byte 0x0f, 0xc7, 0xf0;\n"// rdrand eax #endif "setc %1; " : "=a" (val), "=qm" (rc) : :

[cfe-users] How to detect LLVM Visual Studio Toolset on Windows?

2016-03-12 Thread Jeffrey Walton via cfe-users
We took a bug report for LLVM Visual Studio Toolset on Windows. It appears LLVM defines _MSC_VER but it cannot consume the same programs that Microsoft's compilers can. We now have to figure out a way to detect Clang in this configuration and work around its shortcomings. The "Getting Started with

Re: [cfe-users] How to detect LLVM Visual Studio Toolset on Windows?

2016-03-13 Thread Jeffrey Walton via cfe-users
On Sun, Mar 13, 2016 at 3:42 PM, Csaba Raduly wrote: > Hi Jeffrey, > > Have you tried checking for __clang__ ? Thanks Csaba. The user stated the toolchain does not define some of the familiar ones, like __clang__. From http://github.com/weidai11/cryptopp/issues/147: This toolset defines MSC

Re: [cfe-users] C/C++ system include dirs when cross-compiling

2016-03-24 Thread Jeffrey Walton via cfe-users
On Thu, Mar 24, 2016 at 11:48 AM, Arnaud Allard de Grandmaison via cfe-users wrote: > Hi Patrick, > > This is a common case when cross compiling, so clang knows how to use a > gcc-toolchain installation: you just have to pass it the "--sysroot=..." and > "--toolchain=..." arguments, and it will ge

Re: [cfe-users] C/C++ system include dirs when cross-compiling

2016-03-31 Thread Jeffrey Walton via cfe-users
On Thu, Mar 31, 2016 at 11:50 AM, Patrick Boettcher via cfe-users wrote: > Hi, > > On Thu, 24 Mar 2016 16:48:30 +0100 > Arnaud Allard de Grandmaison wrote: > >> Hi Patrick, >> >> This is a common case when cross compiling, so clang knows how to use >> a gcc-toolchain installation: you just have t

Re: [cfe-users] C/C++ system include dirs when cross-compiling

2016-03-31 Thread Jeffrey Walton via cfe-users
>> We were working around the broken C++ header includes by specifically >> calling them out with -I. See the comment "Fix C++ header paths for >> Ubuntu" at >> https://github.com/weidai11/cryptopp/blob/master/setenv-embedded.sh#L96. > > That's what I did as well to work around. > >> ARM's "GCC ARM

[cfe-users] How to check for std::atomic availability?

2016-05-02 Thread Jeffrey Walton via cfe-users
I'm having trouble parsing docs like http://llvm.org/releases/3.3/tools/clang/docs/LanguageExtensions.html and http://clang.llvm.org/docs/LanguageExtensions.html. I see there's a 'has_feature(c_atomic)'. Its not quite what I am looking for. How do I check for the availability of c++ atomic so I c

[cfe-users] When did Clang provide C++11 mutex?

2016-06-06 Thread Jeffrey Walton via cfe-users
I'm having trouble determining feature availability at compile time. We don't use Autotools and friends; rather, we use the preprocessor. I've been through the release notes from 2.8 through 3.5 (form: ), and I can't find mention of mutex. I've also been to the latest docs, and I can't find a __h

Re: [cfe-users] When did Clang provide C++11 mutex?

2016-06-07 Thread Jeffrey Walton via cfe-users
>> I'm having trouble determining feature availability at compile time. >> We don't use Autotools and friends; rather, we use the preprocessor. >> >> I've been through the release notes from 2.8 through 3.5 (form: ), and >> I can't find mention of mutex. Whoops... here was the form: http://llvm.or

Re: [cfe-users] Clang Analyzer: false positive or am I missing something?

2016-06-25 Thread Jeffrey Walton via cfe-users
On Sat, Jun 25, 2016 at 2:01 PM, Andrew Fuller via cfe-users wrote: > I'm trying to understand an issue reported by Clang's static analysis tool. > The code below demonstrates the issue: > > $ cat problem.c > #include > > int main() { > #if VARIANT==1 >uint32_t data = 0xdeadbeef; >uint8_t

[cfe-users] Use of undeclared identifier '_tzcnt_u64'

2016-06-25 Thread Jeffrey Walton via cfe-users
Hi Everyone, We got a user report of a compile failure using Apple's Clang. I don't know the exact Apple Clang version at the moment. Its on OS X 10.11, and its probably the one bundled with the latest Xcode. Here's the error report (https://groups.google.com/forum/#!topic/cryptopp-users/BI8yGpr2

Re: [cfe-users] Use of undeclared identifier '_tzcnt_u64'

2016-06-26 Thread Jeffrey Walton via cfe-users
We needed this goodness for Clang. Its another case of Clang pretending to be another compiler, but failing to consume a program. The frustrating thing is, we have dedicated code paths for Clang, including inline assembly that works around its integrated assembler bugs. If Clang would stop pretendi

[cfe-users] /usr/bin/ld: cannot find libclang_rt.ubsan_standalone-arm.a: No such file or directory

2016-08-05 Thread Jeffrey Walton via cfe-users
I'm working on Raspberry Pi 3. Its an ARMv8 device with CRC but without Crypto extensions. It also uses a 32-bit OS and hard float configuration. I'm trying to track down a crash that happens under both GCC and Clang on this platform. Other ARM platforms are OK, and i686 and x86_64 are OK. I comp

Re: [cfe-users] clang and intel syntax assembly

2016-09-20 Thread Jeffrey Walton via cfe-users
> - Compile the code using clang with the following command. An assembly > manifest hello.s will be generated > clang -m32 -S -masm=intel hello.c -O1 > > - Assemble the asm file using clang: > clang -m32 -mllvm --x86-asm-syntax=intel hello.s > > It fails with the following error output: > > hello.s

[cfe-users] Problems with hexadecimal constant, _mm_set_epi64x and sign conversion

2018-03-31 Thread Jeffrey Walton via cfe-users
I'm having trouble with Travis during testing. The failed test is available at https://travis-ci.org/Tarsnap/scrypt/jobs/360781179. Clang has rejected my attempts to use the constant (no suffix, ULL and LL): MSG = _mm_add_epi32(MSG0, _mm_set_epi64x(0xE9B5DBA5B5C0FBCF, 0x71374491428A2F98)); MSG =

Re: [cfe-users] Problems with hexadecimal constant, _mm_set_epi64x and sign conversion

2018-04-02 Thread Jeffrey Walton via cfe-users
On Mon, Apr 2, 2018 at 12:30 PM, Matthew Fernandez via cfe-users wrote: > What version of Clang are you using? I cannot tell from the Travis config. I > cannot reproduce this with -Wall -Wextra with any of the Clangs I happen to > have on hand (3.8.0, 4.0.1, 5.0.0). > I believe the Clang versio

Re: [cfe-users] error: unknown target CPU 'pentium-m'

2018-10-02 Thread Jeffrey Walton via cfe-users
On Tue, Oct 2, 2018 at 4:46 AM George Anchev via cfe-users wrote: > ... > So one cannot target architecture 'pentium-m' yet > -mtune for it is possible for that CPU? How can this > be used practically? IOW: how should I modify my > script? Also see https://lists.llvm.org/pipermail/cfe-dev/2016-Ma

[cfe-users] Power9 and __builtin_byte_in_range

2018-11-25 Thread Jeffrey Walton via cfe-users
I'm trying to compile a Power9 program with Clang 7.0: $ $HOME/llvm/bin/clang++ -mcpu=power9 -maltivec TestPrograms/test_ppc_power9.cxx TestPrograms/test_ppc_power9.cxx:6:11: error: use of undeclared identifier '__builtin_byte_in_range' bool x = __builtin_byte_in_range(b, r);

[cfe-users] _Decimal128 on PowerPC

2020-05-08 Thread Jeffrey Walton via cfe-users
Hi Everyone, I'm testing Steven Munroe's pveclib library (https://github.com/munroesj52/pveclib). It is testing OK with GCC, but I am having trouble with Clang. I've been able to test up to Clang 9 and with/without -std=c11, but I keep encountering two errors: decpowof2.c:30:7: error: GNU de

Re: [cfe-users] need help with clang

2021-09-19 Thread Jeffrey Walton via cfe-users
On Mon, Sep 20, 2021 at 1:26 AM Pi Pony via cfe-users wrote: > ... > It's so I can learn to use LLVM and Clang better and contribute to the > community, please pass the knowledge further. > > for ( struct { int i; char* ptr; } loopy = { 0, "LLVM" }; > > loopy.i < 10 && * loopy.ptr != 0; > >

Re: [cfe-users] Clang (with Visual Studio) wrongly complains about missing variables

2021-09-20 Thread Jeffrey Walton via cfe-users
On Mon, Sep 20, 2021 at 7:37 AM John Emmas via cfe-users wrote: > > Hi there - I'm building quite a complex Windows program here using > VS2019. Obviously there's an EXE and there's maybe 30 or so DLLs. Some > DLL's might have code which looks like this in a header file:- > > class whatever

Re: [cfe-users] Clang (with Visual Studio) wrongly complains about missing variables

2021-09-21 Thread Jeffrey Walton via cfe-users
> ... > I checked this morning and sure enough the "/Ob" option doesn't get sent > if I build with VS2019 and Clang - so I'm guessing "/Ob0" wouldn't be > recognised by Clang's compiler? > > So does Clang have it's own command-line option to disable inline > function expansion? Or is that somethi

Re: [cfe-users] Clang (with Visual Studio) wrongly complains about missing variables

2021-09-22 Thread Jeffrey Walton via cfe-users
On Wed, Sep 22, 2021 at 7:21 AM John Emmas via cfe-users wrote: > > On 21/09/2021 14:24, John Emmas via cfe-users wrote: > > > > clang-cl /? reveals that it'll handle the Microsoft variant of /Ob0 > > ... > All the signs here are that Clang is still trying to inline stuff - even > when it's been t

Re: [cfe-users] Clang (with Visual Studio) wrongly complains about missing variables

2021-09-23 Thread Jeffrey Walton via cfe-users
On Thu, Sep 23, 2021 at 12:48 PM David Blaikie via cfe-users wrote: > > On Thu, Sep 23, 2021 at 3:34 AM John Emmas via cfe-users > wrote: >> ... >> Over on llvm-dev I'm trying to persuade them that declaring something as >> __declspec(dllimport) should automatically exclude it from being >> inli

Re: [cfe-users] cfe-users list moving to LLVM Discourse

2022-01-12 Thread Jeffrey Walton via cfe-users
On Wed, Jan 12, 2022 at 1:00 PM Tanya Lattner via cfe-users < cfe-users@lists.llvm.org> wrote: > The cfe-users mailing list will be moved to LLVM Discourse under the > “Using Clang” category (under Clang Frontend). All archives will be > migrated. *This list will be no longer be in use starting Fe