Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 635746 - app-emacs/doxymacs-* won't compile with gcc 7
Summary: app-emacs/doxymacs-* won't compile with gcc 7
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: GNU Emacs project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: gcc-7
  Show dependency tree
 
Reported: 2017-10-29 07:05 UTC by aion1223
Modified: 2017-11-03 09:40 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
patch to /var/tmp/portage/app-emacs/doxymacs-1.8.0-r3/work/doxymacs-1.8.0 (doxymacs.static.inline.patch,2.89 KB, patch)
2017-10-30 04:52 UTC, aion1223
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description aion1223 2017-10-29 07:05:35 UTC
Doxymacs has only one single .c file. In the file, it has inline functions defined as follows, without any other declaration:
 
inline void foo (void) 
{
 // body
}

It might be intended to be inlined at the call sites. There are about 12 inline functions declared and defined in such a way. It worked probably with the default inline-related options in gcc 6.4 or lower. However, it does not work with the default inline-related options with gcc 7. 

The problem seems that gcc 7+ may not generate the function's body in assembly while it may use 'call' instructions at some of the call sites. Thus, in my gentoo AMD64 machine, gcc 7.2 failed to build the package due to the linking time error: "undefined reference to."

I guess, all 'inline' should be replaced with 'static inline' as there is only a single .c file here. Or, the compilation option -fgnu89-inline needs to be added as a walkaround.
Comment 1 Ulrich Müller gentoo-dev 2017-10-29 18:42:54 UTC
Can you provide a patch?
Comment 2 aion1223 2017-10-30 02:10:27 UTC
(In reply to Ulrich Müller from comment #1)
> Can you provide a patch?

If "you" means myself, aion1223@gmail.com, sure, I can and it's my pleasure.
Comment 3 aion1223 2017-10-30 04:52:37 UTC
Created attachment 500966 [details, diff]
patch to /var/tmp/portage/app-emacs/doxymacs-1.8.0-r3/work/doxymacs-1.8.0

Add static inline function declaration would work for both gcc 5.4 (stable) and 7.2 (masked with '**')
Comment 4 aion1223 2017-10-30 04:57:16 UTC
I have just added a patch that I would suggest. I am new to open source bugzilla systems & conventions. I just made my account to report this bug, hoping emerge could build doxymacs at some point in the near future although I use newer gcc such as 7.2 or even upstream. I am not sure if I am following the coding standard, appropriate way of communication, etc. If not, please, kindly let me know. Thank you!
Comment 5 Larry the Git Cow gentoo-dev 2017-11-03 09:39:39 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8a9b51adb08313fd58cb7df7f3f98511d42cb528

commit 8a9b51adb08313fd58cb7df7f3f98511d42cb528
Author:     Ulrich Müller <ulm@gentoo.org>
AuthorDate: 2017-11-03 09:38:56 +0000
Commit:     Ulrich Müller <ulm@gentoo.org>
CommitDate: 2017-11-03 09:38:56 +0000

    app-emacs/doxymacs: Fix compilation with GCC 7.
    
    Closes: https://bugs.gentoo.org/635746
    Package-Manager: Portage-2.3.13, Repoman-2.3.4

 app-emacs/doxymacs/doxymacs-1.8.0-r3.ebuild        |   3 +-
 app-emacs/doxymacs/files/doxymacs-1.8.0-gcc7.patch | 104 +++++++++++++++++++++
 2 files changed, 106 insertions(+), 1 deletion(-)
Comment 6 Ulrich Müller gentoo-dev 2017-11-03 09:40:00 UTC
(In reply to aion1223 from comment #4)
> I have just added a patch that I would suggest. I am new to open source
> bugzilla systems & conventions. I just made my account to report this bug,
> hoping emerge could build doxymacs at some point in the near future although
> I use newer gcc such as 7.2 or even upstream. I am not sure if I am
> following the coding standard, appropriate way of communication, etc. If
> not, please, kindly let me know. Thank you!

All is well. :-) The patch looks good, thank you.