Bug 791292

Summary: Cannot compile C++ application against bluez with new GCC
Product: [Fedora] Fedora Reporter: Petr Pisar <ppisar>
Component: bluezAssignee: Petr Pisar <ppisar>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: bnocera, dwmw2, kevin, marcel, rdieter
Target Milestone: ---Keywords: Patch
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: bluez-4.98-3.fc17 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-02-28 11:35:25 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Fix header files to be compilable in C++
none
Fix bluez 4.98 compilation with GCC 4.7
none
Spec file applying the patches and moving files per usr-move
none
Fix header files to be compilable in C++ none

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.