qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* Misleading configure failure GLIB_SIZEOF_SIZE_T
@ 2021-03-18 12:51 Markus Armbruster
  2021-03-18 13:32 ` Peter Maydell
  0 siblings, 1 reply; 5+ messages in thread
From: Markus Armbruster @ 2021-03-18 12:51 UTC (permalink / raw)
  To: qemu-devel; +Cc: Paolo Bonzini, Daniel P. Berrangé

I just ran into this failure:

    $ ../configure --disable-tools --disable-system --static

    ERROR: sizeof(size_t) doesn't match GLIB_SIZEOF_SIZE_T.
           You probably need to set PKG_CONFIG_LIBDIR
           to point to the right pkg-config files for your
           build target

My config.log ends with

    cc -std=gnu99 -Wall -m64 -mcx16 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fno-common -fwrapv -Wold-style-declaration -Wold-style-definition -Wtype-limits -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wempty-body -Wnested-externs -Wendif-labels -Wexpansion-to-defined -Wimplicit-fallthrough=2 -Wno-missing-include-dirs -Wno-shift-negative-value -Wno-psabi -fstack-protector-strong -pthread -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -o config-temp/qemu-conf.exe config-temp/qemu-conf.c -static -m64 -fstack-protector-strong -lgthread-2.0 -pthread -lglib-2.0 -pthread -lpcre -pthread
    /usr/bin/ld: cannot find -lgthread-2.0
    /usr/bin/ld: cannot find -lglib-2.0
    /usr/bin/ld: cannot find -lpcre
    /usr/bin/ld: cannot find -lpthread
    /usr/bin/ld: cannot find -lc
    collect2: error: ld returned 1 exit status

I need to install more libraries.

The error message "sizeof(size_t) doesn't match GLIB_SIZEOF_SIZE_T." is
wrong.



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Misleading configure failure GLIB_SIZEOF_SIZE_T
  2021-03-18 12:51 Misleading configure failure GLIB_SIZEOF_SIZE_T Markus Armbruster
@ 2021-03-18 13:32 ` Peter Maydell
  2021-03-19  9:40   ` Markus Armbruster
  0 siblings, 1 reply; 5+ messages in thread
From: Peter Maydell @ 2021-03-18 13:32 UTC (permalink / raw)
  To: Markus Armbruster; +Cc: Paolo Bonzini, Daniel P. Berrangé, QEMU Developers

On Thu, 18 Mar 2021 at 12:53, Markus Armbruster <armbru@redhat.com> wrote:
>
> I just ran into this failure:
>
>     $ ../configure --disable-tools --disable-system --static
>
>     ERROR: sizeof(size_t) doesn't match GLIB_SIZEOF_SIZE_T.
>            You probably need to set PKG_CONFIG_LIBDIR
>            to point to the right pkg-config files for your
>            build target

The interesting question here is why the earlier configure check:

write_c_skeleton;
if compile_object ; then
  : C compiler works ok
else
    error_exit "\"$cc\" either does not exist or does not work"
fi
if ! compile_prog ; then
    error_exit "\"$cc\" cannot build an executable (is your linker broken?)"
fi

didn't fail. That is deliberately early in configure in an attempt
to capture this kind of "the compiler can't link anything" case
before we get into specific feature testing.

thanks
-- PMM


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Misleading configure failure GLIB_SIZEOF_SIZE_T
  2021-03-18 13:32 ` Peter Maydell
@ 2021-03-19  9:40   ` Markus Armbruster
  2021-03-19 11:29     ` Paolo Bonzini
  0 siblings, 1 reply; 5+ messages in thread
From: Markus Armbruster @ 2021-03-19  9:40 UTC (permalink / raw)
  To: Peter Maydell; +Cc: Paolo Bonzini, Daniel P. Berrangé, QEMU Developers

Peter Maydell <peter.maydell@linaro.org> writes:

> On Thu, 18 Mar 2021 at 12:53, Markus Armbruster <armbru@redhat.com> wrote:
>>
>> I just ran into this failure:
>>
>>     $ ../configure --disable-tools --disable-system --static
>>
>>     ERROR: sizeof(size_t) doesn't match GLIB_SIZEOF_SIZE_T.
>>            You probably need to set PKG_CONFIG_LIBDIR
>>            to point to the right pkg-config files for your
>>            build target
>
> The interesting question here is why the earlier configure check:
>
> write_c_skeleton;
> if compile_object ; then
>   : C compiler works ok
> else
>     error_exit "\"$cc\" either does not exist or does not work"
> fi
> if ! compile_prog ; then
>     error_exit "\"$cc\" cannot build an executable (is your linker broken?)"
> fi
>
> didn't fail. That is deliberately early in configure in an attempt
> to capture this kind of "the compiler can't link anything" case
> before we get into specific feature testing.

I've since installed the libraries...  uninstalling glibc-static for a
quick check...  Yep, dies in the GLIB_SIZEOF_SIZE_T test.  Let's have a
look at my config.log.  To more easily find the check you pointed out, I
stuck "exit 42" right behind it, and get:

    $ ./config.status 
    [Exit 42 ]
    $ echo $?
    42
    $ tail -n 4 config.log 

    funcs: do_compiler do_cc compile_prog main
    lines: 145 183 2017 0
    cc -std=gnu99 -Wall -m64 -mcx16 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fno-common -fwrapv -o config-temp/qemu-conf.exe config-temp/qemu-conf.c -m64
    $ cat config-temp/qemu-conf.c 
    int main(void) { return 0; }

Run the compiler by hand to confirm:

    $ cc -std=gnu99 -Wall -m64 -mcx16 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fno-common -fwrapv -o config-temp/qemu-conf.exe config-temp/qemu-conf.c -m64
    $ echo $?
    0

The test program doesn't actually need libc, so not having glibc-static
installed doesn't bother the linker.

If it used something from libc, then I'd expect the issue to merely
shift to the next library.  Remember, the failure I reported attempts to
link with -lgthread-2.0 -pthread -lglib-2.0 -pthread -lpcre -pthread.



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Misleading configure failure GLIB_SIZEOF_SIZE_T
  2021-03-19  9:40   ` Markus Armbruster
@ 2021-03-19 11:29     ` Paolo Bonzini
  2021-03-19 12:03       ` Markus Armbruster
  0 siblings, 1 reply; 5+ messages in thread
From: Paolo Bonzini @ 2021-03-19 11:29 UTC (permalink / raw)
  To: Markus Armbruster, Peter Maydell; +Cc: Daniel P. Berrangé, QEMU Developers

On 19/03/21 10:40, Markus Armbruster wrote:
>      $ cc -std=gnu99 -Wall -m64 -mcx16 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fno-common -fwrapv -o config-temp/qemu-conf.exe config-temp/qemu-conf.c -m64
>      $ echo $?
>      0
> 
> The test program doesn't actually need libc, so not having glibc-static
> installed doesn't bother the linker.

I guess the bug is that the invocation does not use -static?

Paolo



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Misleading configure failure GLIB_SIZEOF_SIZE_T
  2021-03-19 11:29     ` Paolo Bonzini
@ 2021-03-19 12:03       ` Markus Armbruster
  0 siblings, 0 replies; 5+ messages in thread
From: Markus Armbruster @ 2021-03-19 12:03 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: Peter Maydell, Daniel P. Berrangé, QEMU Developers

Paolo Bonzini <pbonzini@redhat.com> writes:

> On 19/03/21 10:40, Markus Armbruster wrote:
>>      $ cc -std=gnu99 -Wall -m64 -mcx16 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fno-common -fwrapv -o config-temp/qemu-conf.exe config-temp/qemu-conf.c -m64
>>      $ echo $?
>>      0
>> The test program doesn't actually need libc, so not having
>> glibc-static
>> installed doesn't bother the linker.
>
> I guess the bug is that the invocation does not use -static?

I totally missed that %-}

With -static, cc fails nicely:

    $ cc -std=gnu99 -Wall -m64 -mcx16 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fno-common -fwrapv -o config-temp/qemu-conf.exe config-temp/qemu-conf.c -m64 -static
    /usr/bin/ld: cannot find -lc
    collect2: error: ld returned 1 exit status

Good.  Next test: I install glibc-static and uninstall glib2-static.

    $ ./config.status 

    ERROR: sizeof(size_t) doesn't match GLIB_SIZEOF_SIZE_T.
           You probably need to set PKG_CONFIG_LIBDIR
           to point to the right pkg-config files for your
           build target

*Boing*



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-03-19 12:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-03-18 12:51 Misleading configure failure GLIB_SIZEOF_SIZE_T Markus Armbruster
2021-03-18 13:32 ` Peter Maydell
2021-03-19  9:40   ` Markus Armbruster
2021-03-19 11:29     ` Paolo Bonzini
2021-03-19 12:03       ` Markus Armbruster

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).