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

Some minor build tweaks #651

Merged
merged 6 commits into from
Apr 19, 2018
Merged

Some minor build tweaks #651

merged 6 commits into from
Apr 19, 2018

Conversation

NiLuJe
Copy link
Member

@NiLuJe NiLuJe commented Apr 18, 2018

Encountered during my investigation for #3302

Mostly CMake being weird and failing to build stuff on my system.

Keep the frame-pointer
Don't strip debug symbols
Have I mentioned how much I hate CMake? ^^
It doesn't really solve the issue at hand, but, still.
@Frenzie
Copy link
Member

Frenzie commented Apr 18, 2018

My rant on CMake here: koreader/koreader#3496 (comment) :-P

Not even via glib.
I also tend to let GCC deal with libgcc as it see fits...
(static-libgcc appears to have originally been added for Android,
in db68822).
So let's see if something breaks! \o/
# because cmake needs all kinds of annoying special cmake variables
set(CMAKE_EXE_LINKER_FLAGS "${LDFLAGS} -static-libstdc++")
if(DEFINED ENV{DARWIN})
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -framework CoreFoundation -framework Security")
else()
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libgcc")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like it originates with this commit: db68822

That might mean it should be added to that Android line with the -static flag below.

@NiLuJe
Copy link
Member Author

NiLuJe commented Apr 19, 2018

Yeah, I came to the same commit hash (that was a fun rabbit hole to follow, btw :D).

I wanted to see how the various CI would break ;).

And indeed, that was my idea too for Android, since it appeared clear from the doc that -static doesn't mean -static-libgcc, but I wanted to double-check anyway ;).

@NiLuJe
Copy link
Member Author

NiLuJe commented Apr 19, 2018

Wait, the CIs all passed? Man, that's no fun :D.

On the off-chance it's actually needed for proper runtime behavior.
@NiLuJe
Copy link
Member Author

NiLuJe commented Apr 19, 2018

One day I'll get the itch to see how CMake handles the -l:libname.a syntax to pick stuff up for static linking... Because those absolute paths to a .a are hacky as hell ;p.

@Frenzie
Copy link
Member

Frenzie commented Apr 19, 2018

If I'd known in advance just how messed up CMake was going to handle this stuff I would've just done something like https://github.com/koreader/koreader-base/blob/54e7eae63fa6c9396735133e8b82911bca672568/thirdparty/kpvcrlib/CMakeLists.txt

But by the time it turned out that CMake was refusing to do a proper static Android build I'd already spent so much time on it I figured it was better to just hack the Android build together into something that somehow worked than to start over.

Also if I did start over I'd be more inclined to revamp the whole system with Meson because having to read the CMake source code to understand wtf is going on is a major waste of time. (Yeah, it has "docs"… sure, if that's what you want to call it…)

@NiLuJe
Copy link
Member Author

NiLuJe commented Apr 19, 2018

Yeah, CMake is weird. It's either incredibly straightforward, or incredibly obtuse and cryptic, and there's approximately a billion different toggles and switches that do the exact same thing but not quite, which makes it a massive PITA when it's not behaving as you would expect it to (which, sadly, is often ^^).

@Frenzie
Copy link
Member

Frenzie commented Apr 19, 2018

I think CMake seems to behave very well and appears quite elegant when you're compiling for your own system on your own system, and probably also for your general architecture on your own system. But I really don't understand why it's more popular than Autotools. I mean, I probably don't even half understand Autotools ffs and it has that annoying Perl dependency for Automake, so maybe that's what it's all about but at least it does what it's supposed to when you tell it to!

Incidentally, to me this is probably the definitive Autotools guide: https://autotools.io/index.html

(I'm glad I'm not alone here. I thought everybody was in love with CMake. :-P)

@NiLuJe
Copy link
Member Author

NiLuJe commented Apr 19, 2018

Preaching to the choir ;p.

I mean, autotools is weird as hell, too. But it's so ubiquitous that you're bound to find someone who already encountered the exact same thing, so it's usually easier to figure it out when things go wrong.
Also, docs, yeah. Docs are fine. I love docs. :D.

EDIT: .... And I was going to mention Flameeyes's blogposts, Gentoo developper extraordinaire ;). I learned a lot reading his various rants in his blog and Gentoo bugreports.

EDIT²: I'm not the only one, apparently, c.f. his role tag on https://www.gentoo.org/inside-gentoo/developers/ ^^

@Frenzie
Copy link
Member

Frenzie commented Apr 19, 2018

Haha, ranter. I've been subscribed to his blog since I came across his patch for Elecom trackballs. I ordered the Huge from Japan a few months ago. In the end I've reverted to my Kensington Expert Mouse, unfortunately. I've been meaning to write up a review/rant about the thing.

I've been aware of the Autotools guide for much longer. Actually I didn't even make the connection at first.

Keep them at default, until we know if any of them can actually use
REAGL...
@Frenzie Frenzie merged commit 27fb4bf into koreader:master Apr 19, 2018
Frenzie added a commit to Frenzie/koreader that referenced this pull request Apr 20, 2018
Includes:
* picdocument: fix rendering of animated GIFs koreader/koreader-base#653
* [build] Some minor build tweaks koreader/koreader-base#651
* [chore, CI] Update to latest Docker images koreader/koreader-base#654
* [chore, Kobo] Deprecate Kobo always UTF8Filename() patch koreader/koreader-base#655 (upstream integrated workaround for koreader#542 previous fix in koreader#3845)
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

Successfully merging this pull request may close these issues.

None yet

2 participants