Page MenuHome GnuPG

configure: error: Sorry, the current implemenation requires mmap. due to empty CFLAGS (missing -fPIC)
Closed, ResolvedPublic

Description

Patch to fix attached.

Event Timeline

Update patch to cover libraries search (e.g. iconv).

Please describe the bug and your patch here. A long title is not a sufficient
description. tia.

@werner, have you looked into the patch?

AC_CHECK_FUNCS([mmap]) on Fedora fails to find mmap() due to missing -fPIC.
/usr/bin/ld: /tmp/ccvNyAcN.o: relocation R_X86_64_PC32 against undefined symbol
`mmap@@GLIBC_2.2.5' can not be used when making a shared object; recompile with
-fPIC

We have -fPIC somewhere in default CFLAGS, so just resotre user CFLAGS
before making checks for functions.

That seems to be a regression due to commit 02eb9fc9d5863abcfed6af704e618f8cac7cc2e8

    If the user's CFLAGS include -Werror, then some configure tests fail.
    To avoid this, we only add the user's CFLAGS after all of the
    configure tests have run.

That patch was obviously wrong because configure now has a different picture on
the build system than make. A better solution to the -Werrror problem would be
to pass -Werror only to the make invocation - or more robust to add an
--enable-werror configure flag.

werner raised the priority of this task from Low to Normal.Jan 6 2017, 5:26 PM
werner added a project: gnupg (gpg22).
justus claimed this task.
justus reassigned this task from justus to neal.

Note that simply reverting 02eb9fc9d5863abcfed6af704e618f8cac7cc2e8 will make
our sanitizer build miscompile, likely because -fsanitize=x breaks some test.
This would be easy to fix with my approach, but Werner does not like it.

Justus, I mentioned several solutions on Jabber which do not affect the rule not
to modify CFLAGS.

justus moved this task from Backlog to Blocker on the gnupg (gpg22) board.

@werner, can you please quickly outline how you imagine this to be fixed? Our jabber discussion is gone from my memory, and my client does not keep logs for MUCs for some reason.

I can't remember either. We should swicth back to mailing lists for such things.

One obvious thing is to figure the test which bails on -Werror and fix that test.

werner claimed this task.

I close this for now. If you run into problems with 2.2.2 again, please re-open this bug.