Bug 791292 - Cannot compile C++ application against bluez with new GCC
Cannot compile C++ application against bluez with new GCC
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: bluez (Show other bugs)
rawhide
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Petr Pisar
Fedora Extras Quality Assurance
: Patch
: 797266 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-02-16 11:33 EST by Petr Pisar
Modified: 2012-03-06 15:38 EST (History)
5 users (show)

See Also:
Fixed In Version: bluez-4.98-3.fc17
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-02-28 06:35:25 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)
Fix header files to be compilable in C++ (903 bytes, patch)
2012-02-21 07:58 EST, Petr Pisar
no flags Details | Diff
Fix bluez 4.98 compilation with GCC 4.7 (974 bytes, patch)
2012-02-21 07:58 EST, 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 09:12 EST, Petr Pisar
no flags Details
Fix header files to be compilable in C++ (2.64 KB, patch)
2012-02-28 05:44 EST, Petr Pisar
no flags Details | Diff


External Trackers
Tracker ID Priority Status Summary Last Updated
Launchpad 927097 None None None Never
Debian BTS 657531 None None None Never

  None (edit)
Description Petr Pisar 2012-02-16 11:33:52 EST
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 07:58:01 EST
Created attachment 564665 [details]
Fix header files to be compilable in C++
Comment 2 Petr Pisar 2012-02-21 07:58:45 EST
Created attachment 564666 [details]
Fix bluez 4.98 compilation with GCC 4.7
Comment 3 Petr Pisar 2012-02-21 09:12:47 EST
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 09:29:25 EST
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 13:05:53 EST
*** Bug 797266 has been marked as a duplicate of this bug. ***
Comment 6 Rex Dieter 2012-02-24 13:30:54 EST
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 05:37:54 EST
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 05:44:26 EST
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 05:51:42 EST
The systemd and the assembler problems have been fixed already in 4.98-2.
Comment 10 Fedora Update System 2012-02-28 11:29:53 EST
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 15:38:33 EST
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.