Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fedora build issue #20

Open
brancomat opened this issue May 3, 2020 · 5 comments
Open

Fedora build issue #20

brancomat opened this issue May 3, 2020 · 5 comments

Comments

@brancomat
Copy link

Hi, I'm trying to compile the last freewheeling release on Fedora (by the way: thanks for your work!)

I had a ‘::malloc’ has not been declared error while compiling

c++ is not my cup of tea, but after some googling I found this:
https://nerdland.net/unstumping-the-internet/malloc-has-not-been-declared/

Relevant bit:

When configure tries to test for the presence or GNU-compatibility of malloc and other functions, it compiles a small test program and then tries to run it to see if it works. The problem is that if it fails, configure isn’t smart enough to understand if the reason for failure was related to what it was trying to test or not.

Long story short, the compiling flags to test malloc included a -lSM that was failing on my system since it missed the libSM-devel package.

Even without the malloc test the compilation fails at some point for the missing library, I think it would be better to test the presence of the library in the configure and give some meaningful error if it's missing since it seems a non-optional build dependency.

@brancomat
Copy link
Author

brancomat commented May 3, 2020

Further clarification after a chat with @edigiacomo:
this is not a freewheeling issue, this is a dependency issue internal to the fedora ecosystem.

The AC_PATH_XTRA in the configure.ac triggers the macro in /usr/share/autoconf/autoconf/libs.m4, relevant bit:

AC_CHECK_LIB(ICE, IceConnectionNumber,
[X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"], , $X_EXTRA_LIBS)

and libSM-devel should be a dependency of libICE-devel but for some reason it isn't.

I'll leave the issue open only because the Fedora dependencies in the wiki page Compiling could be updated to avoid the issue:

 su -c 'dnf install libtool gcc-c++ nettle-devel freetype-devel SDL_gfx-devel   \
                    SDL_ttf-devel liblo-devel jack-audio-connection-kit-devel   \
                    libsndfile-devel libxml2-devel libICE-devel libSM-devel libvorbis-devel

(basically: adding libSM-devel to the list)

Also (very optional):
AC_FUNC_MALLOC could be moved before the AC_PATH_XTRA to avoid adding extra libraries to the test

I don't know if it's useful to anyone, but I ended up with a working fedora specfile for rpm packaging, I'll attach it here.
freewheeling_spec.tar.gz

@brancomat brancomat changed the title missing libSM-devel check in configure may result in ‘::malloc’ has not been declared Fedora build issue May 3, 2020
@bill-auger
Copy link
Member

bill-auger commented May 4, 2020 via email

@brancomat
Copy link
Author

Thanks, I didn't know there already was a specfile available. I attached my one to my last comment but yours is better since it considers also suse and mageia (my one was focused on fedora).

It would be great to add the packaging files to the repo (or to link them in wiki?)

FWIW, on arch systems, 'libice' is a dependency of 'libsm' - if fedora has reason to see the implication in the other direction, perhaps an argument could be made for having them be mutually dependent

Yes, I got that wrong. In fedora and debian too libICE is a dependency on libSM.
It's the autoconf macro that seems to reason the other way around, checking ICE symbols and taking libSM presence for granted, so I think it may be considered an autoconf bug.

@brancomat
Copy link
Author

Some more feedback on your specfile, there's a small error in line 13:
%if 0%{?fedora_version} should be %if 0%{?fedora}

Also, I put up a small repo to distribute rpm packages for freewheeling for fedora and suse (mageia builds failed but it's a distro I honestly never used):
https://copr.fedorainfracloud.org/coprs/dbranchini/freewheeling/

I used your spec as a base, I just bumped it to 0.6.6.
I did it for myself but I could easily mantain it, we could add it to the "OS-Specific-Packages" page of the wiki.

I could help for this and the other trivial wiki edits, if you want.

@bill-auger
Copy link
Member

bill-auger commented May 7, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants