You are not logged in.

#1 2015-05-19 11:46:33

jiehong
Member
Registered: 2009-03-19
Posts: 63
Website

[Solved] Clang "-cc1" not recognized

The clang front-end "-cc1" simply does not work. I have tested with clang 3.5 and 3.6.

 $ clang -cc1 --
clang: error: unknown argument: '-cc1'
clang: error: no input files

Same for some others:

clang: error: unknown argument: '-cl-kernel-arg-info'
clang: error: unknown argument: '-cl-std=CL1.2'
clang: error: unknown argument: '-triple'

Is that only me, or Archlinux's clang is acting weird?

Last edited by jiehong (2015-05-19 17:00:33)

Offline

#2 2015-05-19 14:51:20

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,869
Website

Re: [Solved] Clang "-cc1" not recognized

Works for me, in the sense that it grabs stdin and tries to execute whatever I've typed when I press ctrl+d.

This cc1 switch doesn't appear to be documented in the man page though, and this page suggests that it's not supposed to be used directly:

Users should not run clang -cc1 directly, because -cc1 options are not guaranteed to be stable

Is this an X-Y problem? What are you trying to do?

I'm not sure why the -cc1 switch doesn't work for you, have you set up an alias? What does 'type clang' return?

Edit: Mod note: Moving to Programming and Scripting

Last edited by WorMzy (2015-05-19 15:12:27)


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#3 2015-05-19 16:29:37

jiehong
Member
Registered: 2009-03-19
Posts: 63
Website

Re: [Solved] Clang "-cc1" not recognized

XY problem: ok, my real problem is that I'm trying to compile a project that uses clang, and it fails.

However, the alias path was good, and I should have thought about that earlier.

Even though I haven't any alias set for clang for any user, nor any environment variable referring to clang, here is `type clang`:

clang is /usr/lib/hardening-wrapper/bin/clang

I don't know what is this "hardening-wrapper". I just tried with "/usr/bin/clang", and it works perfectly.

Do you also have this "hardening-wrapper" directory?

Offline

#4 2015-05-19 16:43:42

mauritiusdadd
Member
From: Benevento, Italy
Registered: 2013-10-27
Posts: 776

Re: [Solved] Clang "-cc1" not recognized

That is provided by hardening-wrapper. As the description says, the package provides a simple wrapper scripts for building hardened executables by default.

-- edit: Sorry WorMzy, we posted at the same time smile

Last edited by mauritiusdadd (2015-05-19 16:47:04)


About me - github

-- When you have eliminated the impossible, whatever remains, however improbable, must be the truth -- Spock | Sherlock Holmes

Offline

#5 2015-05-19 16:43:50

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,869
Website

Re: [Solved] Clang "-cc1" not recognized

I don't use them myself, but the hardening-wrapper scripts are provided by the hardening-wrapper package.

If you didn't explicitly install this package yourself, presumably it was installed as a dependency (or more likely, a make dependency) for another package. Check with 'pacman -Qi hardening-wrapper', if it's not required by anything, then you can safely remove it.

Edit: Beaten by 8 seconds!

Last edited by WorMzy (2015-05-19 16:45:14)


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#6 2015-05-19 17:00:06

jiehong
Member
Registered: 2009-03-19
Posts: 63
Website

Re: [Solved] Clang "-cc1" not recognized

You are right! I think it was installed for building `mpv`.

I'll be a bit more careful next time wink

Thanks again both of you!

Offline

Board footer

Powered by FluxBB