Bug 791292 - Cannot compile C++ application against bluez with new GCC
Summary: Cannot compile C++ application against bluez with new GCC
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: bluez
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Petr Pisar
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 797266 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-02-16 16:33 UTC by Petr Pisar
Modified: 2012-03-06 20:38 UTC (History)
5 users (show)

Fixed In Version: bluez-4.98-3.fc17
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-02-28 11:35:25 UTC
Type: ---


Attachments (Terms of Use)
Fix header files to be compilable in C++ (903 bytes, patch)
2012-02-21 12:58 UTC, Petr Pisar
no flags Details | Diff
Fix bluez 4.98 compilation with GCC 4.7 (974 bytes, patch)
2012-02-21 12:58 UTC, Petr Pisar
no flags Details | Diff
Spec file applying the patches and moving files per usr-move (25.14 KB, text/plain)
2012-02-21 14:12 UTC, Petr Pisar
no flags Details
Fix header files to be compilable in C++ (2.64 KB, patch)
2012-02-28 10:44 UTC, Petr Pisar
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Debian BTS 657531 0 None None None Never
Launchpad 927097 0 None None None Never

Description Petr Pisar 2012-02-16 16:33:52 UTC
When rebuilding syncevolution, I got this error message from g++ compiler:

/usr/include/bluetooth/bluetooth.h: In function 'uint64_t bt_get_le64(void*)':
/usr/include/bluetooth/bluetooth.h:131:9: error: invalid conversion from 'void*' to 'bt_get_le64(void*)::<anonymous struct>*' [-fpermissive]

This is known bug in bluez header file (http://thread.gmane.org/gmane.linux.bluez.kernel/20364). A patch is posted there.

I checked not yet build bluez-4.98, and it still does the illegal void* cast.

Any chance to patch bluez header files?

Comment 1 Petr Pisar 2012-02-21 12:58:01 UTC
Created attachment 564665 [details]
Fix header files to be compilable in C++

Comment 2 Petr Pisar 2012-02-21 12:58:45 UTC
Created attachment 564666 [details]
Fix bluez 4.98 compilation with GCC 4.7

Comment 3 Petr Pisar 2012-02-21 14:12:47 UTC
Created attachment 564690 [details]
Spec file applying the patches and moving files per usr-move

Without the usr-move tunes rpmbuild fails on missing or unpackaged files.

Comment 4 Petr Pisar 2012-02-21 14:29:25 UTC
I have not Bluetooth hardware to test it, but it compiles and installs cleanly, it compiles in Koji (http://koji.fedoraproject.org/koji/taskinfo?taskID=3807373) and it allows me to rebuild syncevolution.

Can I push it to the Fedora, or are you going to do it yourself?

Comment 5 Rex Dieter 2012-02-24 18:05:53 UTC
*** Bug 797266 has been marked as a duplicate of this bug. ***

Comment 6 Rex Dieter 2012-02-24 18:30:54 UTC
Petr, re-review the aforementioned thread, I think a newer version of the patch was adopted, for example,
https://launchpadlibrarian.net/91997861/fix_bluez.patch

I don't have any strong preference personally, either approach is better than the status quo.

Comment 7 Petr Pisar 2012-02-27 10:37:54 UTC
I think it's better to introduce the same bug into all applications than to have different results for C and C++. This is the only difference in the two patches. The bigger bug the sooner we can discover it.

IMHO, the change has no impact in C because void* can be casted to or from any other pointer type. The *__p = (whatever *) (ptr) does not mangle the pointer value, so __p gets exactly the same value as ptr.

But I have not problem to push the same patch as Debian. Upstream has not yet committed any fix.

Comment 8 Petr Pisar 2012-02-28 10:44:26 UTC
Created attachment 566289 [details]
Fix header files to be compilable in C++

This is Debian patch for the same issue. I will commit this one.

Comment 9 Petr Pisar 2012-02-28 10:51:42 UTC
The systemd and the assembler problems have been fixed already in 4.98-2.

Comment 10 Fedora Update System 2012-02-28 16:29:53 UTC
bluez-4.98-3.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/bluez-4.98-3.fc17

Comment 11 Fedora Update System 2012-03-06 20:38:33 UTC
bluez-4.98-3.fc17 has been pushed to the Fedora 17 stable repository.  If problems still persist, please make note of it in this bug report.


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