Bug 13543 - clang fails to include cxxabi.h
Summary: clang fails to include cxxabi.h
Status: RESOLVED FIXED
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: Cauldron
Hardware: x86_64 Linux
Priority: Normal normal
Target Milestone: ---
Assignee: Thomas Backlund
QA Contact:
URL: http://lists.cs.uiuc.edu/pipermail/cf...
Whiteboard: MGA4TOO
Keywords: Triaged
Depends on: 13811
Blocks:
  Show dependency treegraph
 
Reported: 2014-06-18 16:55 CEST by Christian Lohmaier
Modified: 2014-07-28 11:34 CEST (History)
3 users (show)

See Also:
Source RPM: gcc, llvm
CVE:
Status comment:


Attachments

Description Christian Lohmaier 2014-06-18 16:55:54 CEST
Description of problem:
trying to compile something with clang that includes cxxabi.h header fails

see this thread http://lists.cs.uiuc.edu/pipermail/cfe-dev/2012-February/019909.html for details.

What I did as a workaround when building my own package was:
 
ln -s /usr/lib/gcc/x86_64-mageia-linux-gnu/4.8.2/include/cxxabi.h %{buildroot}%{_prefix}/lib/clang/%{version}/include/
ln -s /usr/lib/gcc/x86_64-mageia-linux-gnu/4.8.2/include/bits/ %{buildroot}%{_prefix}/lib/clang/%{version}/include/

- but that of course that would need tweaking for official packages

Reproducible: 

Steps to Reproduce:
Manuel Hiebel 2014-06-29 21:21:15 CEST

Keywords: (none) => Triaged
CC: (none) => anssi.hannula, thierry.vignaud, tmb

Comment 1 Thomas Backlund 2014-06-29 21:49:07 CEST
or just pass an -I/usr/lib/gcc/x86_64-mageia-linux-gnu/4.8.2/include during build of your project
Comment 2 Christian Lohmaier 2014-06-29 22:12:29 CEST
That's not really a solution since that then adds other headers into the searchpath that should not be added/taken from clang instead.
Comment 4 Thierry Vignaud 2014-07-01 10:11:00 CEST
(In reply to Christian Lohmaier from comment #2)
> That's not really a solution since that then adds other headers into the
> searchpath that should not be added/taken from clang instead.

And the presence of those headers break compiling with clang...
Comment 5 Thierry Vignaud 2014-07-01 10:19:22 CEST
Thomas, note that FC have it in /usr/include/c++/4.*/cxxabi.h

Source RPM: llvm => gcc, llvm

Comment 6 Thierry Vignaud 2014-07-01 10:54:23 CEST
The question is: why do we move it away?


# Move <cxxabi.h> to compiler-specific directories
%if %{build_cxx}
mkdir -p $FULLPATH/include/bits/
mv %{buildroot}%{libstdcxx_includedir}/cxxabi.h $FULLPATH/include/
mv %{buildroot}%{libstdcxx_includedir}/%{gcc_target_platform}/bits/cxxabi_tweaks.h $FULLPATH/include/bits/
%endif

This came from mdv...
We were already doing it when importing packages in SVN:
http://svn.mandriva.com/viewvc/packages/cooker/gcc/current/SPECS/gcc.spec?revision=2665&view=markup&pathrev=47181

we were already doing it in 2003:
http://vserver.13thfloor.at/Stuff/gcc-3.3.4.spec
Comment 7 Thierry Vignaud 2014-07-01 10:56:11 CEST
Can we stop doing this? We're the only ones to do so and we don't even know why we do it (a 12+ year undocumented hack)
Comment 8 Thierry Vignaud 2014-07-01 11:09:03 CEST
It was already done in libstdc++3.0-devel-3.0.4-2mdk but not in libstdc++3.0-devel-3.0.1-1.1mdk.i586.rpm:
http://sophie.zarb.org/distrib/Mandriva/8.2/i586/by-pkgid/b5527029b6c2844eaaf502cba379547d/files
http://sophie.zarb.org/rpms/16247870ea0fc18dbc96630f264c172c/files

Which points to:

* Wed Feb 20 2002 Gwenole Beauchesne <gbeauchesne@mandrakesoft.com> 3.0.4-0.4mdk

- Move into gcc3-specific includedir

(w/o any explanation)
(from http://sophie.zarb.org/distrib/Mandriva/8.2/i586/by-pkgid/b5527029b6c2844eaaf502cba379547d/changelog)


So please kill that move

Version: 4 => Cauldron
Assignee: bugsquad => tmb
Whiteboard: (none) => MGA4TOO

Comment 9 Thomas Backlund 2014-07-01 11:21:25 CEST
Not so fast...

It's because we have a setup that supports having several gcc versions installed at the same time...

currently we support both gcc3.3 and gcc 4.7 (mga3) / gcc 4.8 (mga4) / 4.9 (cauldron)
Comment 10 Thierry Vignaud 2014-07-01 12:30:46 CEST
And what?
FC has it in /usr/include/c++/4.8.3/cxxabi.h
What's wrong with that?
There's nothing preventing supporting both gcc3.3 & 4.x.
And even if it were the case, we could only support having one gcc installed at a time but I dont' think we even have to go there.
Note that FC has compat-gcc3* too

Do we even have stuff that needs gcc3.3's g++ and not just gcc?
Comment 11 Thomas Backlund 2014-07-01 12:50:33 CEST
Well, we are not FC.

There is nothing that says we have to do everything that FC does, 
if that would be the case we might as well just run / use FC and be done with it.

I actually like to test things before I change stuff...
Comment 12 Thierry Vignaud 2014-07-01 14:38:23 CEST
Sure.
But for now we cannot use clang for many c++ software.
(eg I cannot compile firefox 31 with either gcc-4.9 or clang).

And the default (aka not FC's but upstream's) path is versioned, so how can it break having several compilers installed?
Comment 13 Thomas Backlund 2014-07-01 20:12:50 CEST

Ok, until I have time to verify all of this, 
I chose to "fix" it in gcc-4.9.1-0.20140625.2.mga5 currently building with:

- ship cxxabi.h and cxxabi_tweaks.h in both upstream default path for clang
  to work and Mageia specific path to keep backward compatibility (mga#13543)
Comment 14 Thierry Vignaud 2014-07-02 09:32:57 CEST
Thanks I can now compile ff with clang.
Comment 15 Thomas Backlund 2014-07-28 11:34:09 CEST
Fix in comment 13 pushed to 4 updates_testing as part of an gcc miscompilation update fix:
https://bugs.mageia.org/show_bug.cgi?id=13811

Status: NEW => RESOLVED
Resolution: (none) => FIXED
Depends on: (none) => 13811


Note You need to log in before you can comment on or make changes to this bug.