Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 689540 - media-libs/harfbuzz-2.3.1 fails to build with gcc-8.3.0 and -fno-builtin-strlen in C(XX)FLAGS
Summary: media-libs/harfbuzz-2.3.1 fails to build with gcc-8.3.0 and -fno-builtin-strl...
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Office Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-07-09 15:32 UTC by erinks724
Modified: 2022-06-29 06:51 UTC (History)
0 users

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


Attachments
Build environment and log (build.log,49.60 KB, text/plain)
2019-07-09 15:32 UTC, erinks724
Details
fix patch (harfbuzz.patch,478 bytes, patch)
2019-07-09 15:33 UTC, erinks724
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description erinks724 2019-07-09 15:32:25 UTC
Created attachment 582252 [details]
Build environment and log

harfbuzz-2.3.1 fails to build with gcc-8.3.0 on my system. The relevant compile error is:

libtool: compile:  x86_64-pc-linux-gnu-g++ -m32 -DHAVE_CONFIG_H -I. -I/var/tmp/portage/media-libs/harfbuzz-2.3.1/work/harfbuzz-2.3.1/src -I.. -pthread -I/usr/include/glib-2.0 -I/usr/lib32/glib-2.0/include -I/usr/include/freetype2 -I/var/tmp/portage/media-libs/harfbuzz-2.3.1/work/harfbuzz-2.3.1/src/hb-ucdn -DHB_NDEBUG -fno-rtti -march=native -pipe -fno-builtin-strlen -ggdb -std=c++14 -fno-exceptions -fno-threadsafe-statics -fvisibility-inlines-hidden -c /var/tmp/portage/media-libs/harfbuzz-2.3.1/work/harfbuzz-2.3.1/src/hb-buffer-serialize.cc  -fPIC -DPIC -o .libs/libharfbuzz_la-hb-buffer-serialize.o
/var/tmp/portage/media-libs/harfbuzz-2.3.1/work/harfbuzz-2.3.1/src/hb-common.cc: In function ‘void _hb_options_init()’:
/var/tmp/portage/media-libs/harfbuzz-2.3.1/work/harfbuzz-2.3.1/src/hb-common.cc:70:53: error: comparison of integer expressions of different signedness: ‘size_t’ {aka ‘unsigned int’} and ‘int’ [-Werror=sign-compare]
  if (0 == strncmp (c, name, p - c) && strlen (name) == p - c) u.opts.symbol = true;
                                       ~~~~~~~~~~~~~~^~~~~~~~
/var/tmp/portage/media-libs/harfbuzz-2.3.1/work/harfbuzz-2.3.1/src/hb-common.cc:72:7: note: in expansion of macro ‘OPTION’
       OPTION ("uniscribe-bug-compatible", uniscribe_bug_compatible);
       ^~~~~~
/var/tmp/portage/media-libs/harfbuzz-2.3.1/work/harfbuzz-2.3.1/src/hb-common.cc:70:53: error: comparison of integer expressions of different signedness: ‘size_t’ {aka ‘unsigned int’} and ‘int’ [-Werror=sign-compare]
  if (0 == strncmp (c, name, p - c) && strlen (name) == p - c) u.opts.symbol = true;
                                       ~~~~~~~~~~~~~~^~~~~~~~
/var/tmp/portage/media-libs/harfbuzz-2.3.1/work/harfbuzz-2.3.1/src/hb-common.cc:73:7: note: in expansion of macro ‘OPTION’
       OPTION ("aat", aat);
       ^~~~~~

Which appears to be the result of more strict error checking in newer versions of GCC. I have attached my full build log with the relevant emerge info appended to the top.

I am unsure if this should be reported upstream or not.
Comment 1 erinks724 2019-07-09 15:33:27 UTC
Created attachment 582254 [details, diff]
fix patch

This is my (probably naive) very simple patch that fixes it on my system
Comment 2 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2019-07-09 20:33:12 UTC
This harfbuzz version builds fine on my ~amd64 machine with sys-devel/gcc-8.3.0-r1

Please post the output of

  emerge --info harfbuzz

to this bug.
Comment 3 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2019-07-09 20:34:16 UTC
Nevermind, you did put that information into the attachment...
Comment 4 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2019-07-09 20:46:38 UTC
Any specific reason you have "-fno-builtin-strlen" in your C(XX)FLAGS?
Comment 5 erinks724 2019-07-09 23:03:17 UTC
Yup, that is what is going on. Removing -fno-builtin-strlen from C(XX)FLAGS allows harfbuzz-2.3.1 to build without my patch.

This is kind of odd. Shouldn't the gcc builtin strlen return the same type as the one defined in cstring? Regardless, this isn't really a harfbuzz bug I suppose.
Comment 6 erinks724 2019-07-09 23:04:44 UTC
I added -fno-builtin-strlen when I was setting up Valgrind I think. The proper place for that is in an env file for glibc, not system wide.