Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 621532 - net-libs/webkit-gtk-2.4.11-r200 with dev-libs/icu-59 - Source/JavaScriptCore/API/JSStringRef.cpp:86:30: error: invalid conversion from ‘const UChar* {aka const char16_t*}’ to ‘const JSChar* {aka const short unsigned int*}’ [-fpermissive]
Summary: net-libs/webkit-gtk-2.4.11-r200 with dev-libs/icu-59 - Source/JavaScriptCore/...
Status: RESOLVED OBSOLETE
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal with 4 votes (vote)
Assignee: Gentoo Linux Gnome Desktop Team
URL: https://bugs.webkit.org/show_bug.cgi?...
Whiteboard:
Keywords:
: 639634 639866 641772 642122 644874 646654 (view as bug list)
Depends on:
Blocks: icu-59
  Show dependency tree
 
Reported: 2017-06-11 16:49 UTC by Andreas K. Hüttel
Modified: 2018-07-09 06:42 UTC (History)
47 users (show)

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


Attachments
build log (webkit-gtk-2.4.11-r200:20170611-160129.log.bz2,344.89 KB, application/x-bzip)
2017-06-11 16:50 UTC, Andreas K. Hüttel
Details
backported patch (icu59.patch,3.01 KB, patch)
2017-06-11 18:43 UTC, Andreas K. Hüttel
Details | Diff
build.log for failed build: net-libs/webkit-gtk-2.4.11-r1 (build.log.bz2,404.75 KB, application/x-bzip)
2017-12-12 04:12 UTC, ᎫᏤᏣ (kuzetsa)
Details
webkit-gtk-2.4.11-r1 static_cast patch (typedef_wkchar.patch,467 bytes, patch)
2017-12-17 23:02 UTC, Leonardo Ferraguzzi
Details | Diff
webkit-gtk-2.4.11-r1 static_cast patch (typedef_wkchar.patch,611 bytes, patch)
2017-12-17 23:29 UTC, Leonardo Ferraguzzi
Details | Diff
webkit-gtk-2.4.11-WKString-typedef (webkit-gtk-2.4.11-WKString-typedef.patch,589 bytes, patch)
2017-12-21 08:15 UTC, Ervin Peters
Details | Diff
webkit-gtk-JSStringRef-typedef.patch (webkit-gtk-2.4.11-JSStringRef-typedef.patch,526 bytes, patch)
2017-12-21 08:17 UTC, Ervin Peters
Details | Diff
webkit-gtk-2.4.11-r2.ebuild (webkit-gtk-2.4.11-r2.ebuild,8.87 KB, text/plain)
2017-12-21 08:19 UTC, Ervin Peters
Details
webkit-gtk-2.4.11-r201.ebuild (webkit-gtk-2.4.11-r201.ebuild,8.29 KB, text/plain)
2017-12-21 08:21 UTC, Ervin Peters
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas K. Hüttel gentoo-dev 2017-06-11 16:49:22 UTC
Source/JavaScriptCore/API/JSStringRef.cpp: In function ‘const JSChar* JSStringGetCharactersPtr(JSStringRef)’:
Source/JavaScriptCore/API/JSStringRef.cpp:86:30: error: invalid conversion from ‘const UChar* {aka const char16_t*}’ to ‘const JSChar* {aka const short unsigned int*}’ [-fpermissive]
     return string->characters();
            ~~~~~~~~~~~~~~~~~~^~

and more...
Comment 1 Andreas K. Hüttel gentoo-dev 2017-06-11 16:50:14 UTC
Created attachment 476068 [details]
build log
Comment 2 Andreas K. Hüttel gentoo-dev 2017-06-11 16:51:25 UTC
pinacolada ~ # emerge --info --verbose=n
Portage 2.3.6 (python 2.7.12-final-0, default/linux/amd64/17.0/desktop/plasma, gcc-6.3.0, glibc-2.23-r3, 4.9.29-gentoo x86_64)
=================================================================
System uname: Linux-4.9.29-gentoo-x86_64-Intel-R-_Core-TM-_i7-6700_CPU_@_3.40GHz-with-gentoo-2.3
KiB Mem:    16381980 total,   3789468 free
KiB Swap:   25165816 total,  23077564 free
sh bash 4.3_p48-r1
ld GNU ld (Gentoo 2.26.1 p1.0) 2.26.1
app-shells/bash:          4.3_p48-r1::gentoo
dev-java/java-config:     2.2.0-r3::gentoo
dev-lang/perl:            5.24.1-r2::gentoo
dev-lang/python:          2.7.12::gentoo, 3.4.5::gentoo
dev-util/cmake:           3.7.2::gentoo
dev-util/pkgconfig:       0.28-r2::gentoo
sys-apps/baselayout:      2.3::gentoo
sys-apps/openrc:          0.26.3::gentoo
sys-apps/sandbox:         2.10-r3::gentoo
sys-devel/autoconf:       2.13::gentoo, 2.69::gentoo
sys-devel/automake:       1.11.6-r1::gentoo, 1.15-r2::gentoo
sys-devel/binutils:       2.26.1::gentoo
sys-devel/gcc:            4.9.4::gentoo, 5.4.0-r3::gentoo, 6.3.0::gentoo
sys-devel/gcc-config:     1.7.3-r1::dilfridge
sys-devel/libtool:        2.4.6-r3::gentoo
sys-devel/make:           4.2.1::gentoo
sys-kernel/linux-headers: 4.4::gentoo (virtual/os-headers)
sys-libs/glibc:           2.23-r3::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: git
    sync-uri: git://anongit.gentoo.org/repo/gentoo.git
    priority: -1000

kde
    location: /usr/local/portage/kde
    sync-type: git
    sync-uri: git://anongit.gentoo.org/proj/kde.git
    masters: gentoo
    priority: 100

vmware
    location: /usr/local/portage/vmware
    sync-type: git
    sync-uri: git://anongit.gentoo.org/proj/vmware.git
    masters: gentoo
    priority: 100

dilfridge
    location: /usr/local/portage/dilfridge
    sync-type: git
    sync-uri: git://anongit.gentoo.org/dev/dilfridge.git
    masters: gentoo
    priority: 9999

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe -ggdb -frecord-gcc-switches"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /etc/stunnel/stunnel.conf /usr/lib64/libreoffice/program/sofficerc /usr/share/config /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php7.0/ext-active/ /etc/php/cgi-php7.0/ext-active/ /etc/php/cli-php7.0/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-march=native -O2 -pipe -ggdb -frecord-gcc-switches"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="-v --keep-going --quiet-build=n --with-bdeps=y"
FCFLAGS="-march=native -O2 -pipe -ggdb -frecord-gcc-switches"
FEATURES="assume-digests binpkg-logs binpkg-multi-instance buildpkg compress-build-logs compressdebug config-protect-if-modified distlocks ebuild-locks fakeroot fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms split-log splitdebug strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync"
FFLAGS="-march=native -O2 -pipe -ggdb -frecord-gcc-switches"
GENTOO_MIRRORS="http://ftp.uni-erlangen.de/pub/mirrors/gentoo http://gentoo.lagis.at/ http://ftp-stud.hs-esslingen.de/pub/Mirrors/gentoo/ http://mirror.switch.ch/ftp/mirror/gentoo/"
LANG="de_DE.UTF-8"
LDFLAGS="-Wl,--as-needed -Wl,-O1 -Wl,--hash-style=gnu"
MAKEOPTS="-j9"
PKGDIR="/chroot/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
USE="X a52 aac accessibility acpi akonadi alsa amd64 analogtv animgif apache2 archive arts attica audiofile bash-completion berkdb binfilter bittorrent bluetooth branding bzip2 cairo cdaudio cdda cddax cddb cdparanoia cdr chm cisco cli clucene cmake compat consolekit context corefonts cracklib crypt css cups cupsddk curl cvs cxx dbus declarative divx djvu dri dts dv dvd dvdr dvipdfm ebook emboss encode enscript exif expat expoblending extra extras fam ffmpeg firefox flac fortran fping ftp g3dvl gcj gd gdbm geolocation gif gimp git glamor glitz gmp gnuplot google gpg gphoto2 gpm gps graphics graphviz groupwise gs gtk handbook hbci hddtemp hybrid-auth iconv icu id3 id3tag idea imagemagick imap inotify jadetex java java6 jingle jpeg jpeg2k kde kdepim kipi konqueror kontact kpathsea kwallet lame laptop lasi latex latex3 lcms ldap libnotify lm_sensors luatex lzma mad math mbox mediawiki mikmod mime minizip mjpeg mmx mng mod modules mp3 mp4 mp4live mpeg mplayer multilib mysql ncurses nls nokia notify nptl nsplugin obex ofx ogg openexr opengl openmp pam pango pcre pdf perl phonon php pkcs11 plasma player plotutils png policykit ppds publishers python qml qt3support qt4 qt5 quicktime qwt raptor rdesktop readline redeyes redland rendering reports samba sasl science script sdk sdl seccomp semantic-desktop session sftp slp smartcard smp sndfile sockets sql sqlite sse sse2 ssl ssse3 startup-notification subtitles subversion svg syslog tahoma tcl tcpd theora threads tiff tk tordns truetype udev udisks unicode upower usb v4l v4l2 vcd vdpau video virtuoso vmware-tools vmware_guest_windows vnc vorbis wav weather webdav webdav-neon webkit webm widgets wmf wpd wv2 wxwidgets x264 xcb xcomposite xetex xine xinerama xls xml xmp xpm xscreensaver xulrunner xv xvfb xvid zip zlib" ABI_X86="64" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_core authn_dbm authn_file authz_core authz_dbm authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir env expires ext_filter file_cache filter headers include info log_config logio mime mime_magic negotiation rewrite setenvif socache_shmcb speling status unixd userdir usertrack vhost_alias version" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2 canon" COLLECTD_PLUGINS="df interface iptables irq load memory rrdtool swap syslog openvz curl_json uuid netlink" CPU_FLAGS_X86="aes avx avx2 fma3 mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="evdev wacom" KERNEL="linux" L10N="de en en_GB" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="de en en_GB" LIRC_DEVICES="devinput hauppauge hauppauge_dvb" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-6" PYTHON_SINGLE_TARGET="python3_4" PYTHON_TARGETS="python2_7 python3_4" QEMU_SOFTMMU_TARGETS="i386 x86_64 arm ppc ppc64" QEMU_USER_TARGETS="i386 x86_64 arm ppc ppc64" RUBY_TARGETS="ruby21 ruby22" USERLAND="GNU" VIDEO_CARDS="nvidia" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON
Comment 3 Andreas K. Hüttel gentoo-dev 2017-06-11 18:43:54 UTC
Created attachment 476110 [details, diff]
backported patch

Attached patch makes the library build against ICU 59. I'll use it over the next days on my own system to see if anything breaks. 

Not tested against older ICU yet.
Comment 4 Andreas K. Hüttel gentoo-dev 2017-10-08 16:15:37 UTC
It would be nice to have this in the tree now.

(On my 17.0 profile, webkit-gtk-2.4.11-r200 blocks the emerge...)
Comment 5 Thomas 2017-11-26 16:17:10 UTC
(In reply to Andreas K. Hüttel from comment #3)
> Attached patch makes the library build against ICU 59.

NetBSD has a patch, too, which looks more simple and works for me: ftp://ftp.netbsd.org/pub/pkgsrc/current/pkgsrc/www/webkit24-gtk/patches/patch-Source_JavaScriptCore_API_JSStringRef.cpp

Sidenote: Emerge can't apply the patch untill you change the lines

--- Source/JavaScriptCore/API/JSStringRef.cpp.orig	2016-04-10 06:48:36.000000000 +0000
+++ Source/JavaScriptCore/API/JSStringRef.cpp

to

--- a/Source/JavaScriptCore/API/JSStringRef.cpp	2016-04-10 06:48:36.000000000 +0000
+++ b/Source/JavaScriptCore/API/JSStringRef.cpp
Comment 6 Uwe Sauter 2017-12-05 19:56:27 UTC
Downloading the patch and applying the fixes from comment #5 works for me in combination with =dev-libs/icu-60.1.
Comment 7 Andreas K. Hüttel gentoo-dev 2017-12-09 20:13:20 UTC
*** Bug 639634 has been marked as a duplicate of this bug. ***
Comment 8 N. Andrew Walsh 2017-12-11 13:00:24 UTC
I applied the patch from Comment #5 to webkit-gtk-2.4.11-r1, and got the following error:

Source/WebKit2/Shared/API/c/WKString.cpp:58:72: error: invalid static_cast from type ‘WKChar* {aka short unsigned int*}’ to type ‘UChar* {aka char16_t*}’

Is this a different issue from the one discussed here?
Comment 9 Fred Krogh 2017-12-11 18:45:08 UTC
I've attempted and failed to match what was done in comment 6.  I put the corrected patch file in the /etc/portage/patches/net-libs/webkit-gtk-2.4.11-r200 directory.  It fails with a complete build log that is almost a gigabyte.  In the build log I see a number of patches being applied, but not the one mentioned above.  I'm guessing that this means the patch did not get applied.  If that is the case perhaps someone could point out where my error is likely to be.  Thanks.
Comment 10 Matt Whitlock 2017-12-11 18:51:41 UTC
(In reply to Fred Krogh from comment #9)
> I've attempted and failed to match what was done in comment 6.  I put the
> corrected patch file in the
> /etc/portage/patches/net-libs/webkit-gtk-2.4.11-r200 directory.  It fails
> with a complete build log that is almost a gigabyte.  In the build log I see
> a number of patches being applied, but not the one mentioned above.  I'm
> guessing that this means the patch did not get applied.  If that is the case
> perhaps someone could point out where my error is likely to be.  Thanks.

Check for typos. I saved the corrected patch file as "/etc/portage/patches/net-libs/webkit-gtk:2/patch-Source_JavaScriptCore_API_JSStringRef.cpp", and the build was successful for me (with patch being applied).
Comment 11 Fred Krogh 2017-12-11 21:44:11 UTC
I don't understand the reason for your directory name for storing the patch, but using exactly the same name for the directory and patch file as you, my results are unchanged, i.e. failure and no mention of the this patch in the build log.
Comment 12 Markus Rathgeb 2017-12-11 21:56:37 UTC
IIRC the ebuild is using EAPI 5.
I added epatch_user to the ebuild and placed the patch file in /etc/portage/patches before merging it.

https://wiki.gentoo.org/wiki//etc/portage/patches
Comment 13 Fred Krogh 2017-12-11 22:03:30 UTC
My ebuild has the line
EAPI="6"
So that means it should pick up the patch?
Comment 14 Markus Rathgeb 2017-12-11 22:06:43 UTC
I don't know. You could try to add eapply_user
Comment 15 Fred Krogh 2017-12-12 01:21:00 UTC
I'm not sure what you suggested I do.  I tried adding
eapply_user
to a line of webkit-gtk-2.4.11-r200.ebuild and that resulted in this being masked due to corruption.  So I guess you were suggesting adding it someplace else, but I have no idea where.
Comment 16 ᎫᏤᏣ (kuzetsa) 2017-12-12 04:12:51 UTC
Created attachment 509564 [details]
build.log for failed build: net-libs/webkit-gtk-2.4.11-r1

uncovered issue during test of system-icu on chromium.  
(setting package.keywords entry)  
<dev-libs/icu-60 ~amd64

result:

keyword stabilized [ net-libs/webkit-gtk-2.4.11-r1 ] fails to build.

Source/JavaScriptCore/API/JSStringRef.cpp:86:30: error: invalid conversion from 
‘const UChar* {aka const char16_t*}’ to ‘const JSChar* {aka const short unsigned int*}’ [-fpermissive]
     return string->characters();
            ~~~~~~~~~~~~~~~~~~^~

This is with dev-libs/icu version dev-libs/icu-59.1
Comment 17 rnddim 2017-12-13 02:12:40 UTC
Applying the backported patch attached to this bug allowed webkit-gtk to compile for me. But for whatever reason I did not need to make the correction in comment #5 , nor does any part of the patch resemble the suggested changes. Was the patch updated and it's not noted in the comment history?
Comment 18 Matt Whitlock 2017-12-13 07:09:26 UTC
(In reply to rnddim from comment #17)
> Applying the backported patch attached to this bug allowed webkit-gtk to
> compile for me. But for whatever reason I did not need to make the
> correction in comment #5 , nor does any part of the patch resemble the
> suggested changes. Was the patch updated and it's not noted in the comment
> history?

The fixup in Comment #5 applies to the patch linked in that same comment. It is suggested to use the patch linked in Comment #5 rather than the patch attached in Comment #3.
Comment 19 Denis Descheneaux 2017-12-13 08:36:54 UTC
With latest dev-libs/icu-60.2

@preserved-rebuild fail net-libs/webkit-gtk-2.4.11-r200

Use patch from comment 5 + add eaply_user to ebuild, and builds successfully


>>> Original instance of package unmerged safely.
>>> net-libs/webkit-gtk-2.4.11-r200 merged.
>>> Regenerating /etc/ld.so.cache...

 * Messages for package net-libs/webkit-gtk-2.4.11-r200:

 * Package:    net-libs/webkit-gtk-2.4.11-r200
 * Repository: gentoo
 * Maintainer: gnome@gentoo.org
 * USE:        X abi_x86_64 amd64 egl elibc_glibc geoloc gnome-keyring gstreamer introspection jit kernel_linux opengl spell userland_GNU webgl
 * FEATURES:   preserve-libs sandbox selinux sesandbox userpriv usersandbox

 * Messages for package net-libs/webkit-gtk-2.4.11-r200:

 * Package:    net-libs/webkit-gtk-2.4.11-r200
 * Repository: gentoo
 * Maintainer: gnome@gentoo.org
 * USE:        X abi_x86_64 amd64 egl elibc_glibc geoloc gnome-keyring gstreamer introspection jit kernel_linux opengl spell userland_GNU webgl
 * FEATURES:   preserve-libs sandbox selinux sesandbox userpriv usersandbox
 * Applying webkit-gtk-1.11.90-gtk-docize-fix.patch ...
 * Applying webkit-gtk-2.2.5-hppa-platform.patch ...
 * Applying webkit-gtk-2.2.5-ia64-platform.patch ...
 * Applying webkit-gtk-2.4.1-ia64-malloc.patch ...
 * Applying webkit-gtk-2.4.4-jpeg-9a.patch ...
 * Applying webkit-gtk-2.4.7-disable-webgl.patch ...
 * Applying webkit-gtk-2.4.11-video-web-audio.patch ...
 * Applying webkit-gtk-2.4.9-gcc-6.patch ...
 * Applying backported-621532.patch ...
 * User patches applied.
 * Running eautoreconf in '/var/tmp/portage/net-libs/webkit-gtk-2.4.11-r200/work/webkitgtk-2.4.11' ...
 * Running gtkdocize --copy ...
 * Running libtoolize --install --copy --force --automake ...
 * Running aclocal -I Source/autotools ...
 * Running autoconf -I Source/autotools --force ...
 * Running autoheader -I Source/autotools ...
 * Running automake --add-missing --copy --foreign --force-missing ...
 * Disabling deprecation warnings ...
 * Removing unnecessary /usr/lib64/libwebkitgtk-1.0.la (no static archive)
 * Removing unnecessary /usr/lib64/libjavascriptcoregtk-1.0.la (no static archive)
 * PT_PAX marking -m /var/tmp/portage/net-libs/webkit-gtk-2.4.11-r200/image/usr/bin/jsc-1 with paxctl
 * PT_PAX marking -m /var/tmp/portage/net-libs/webkit-gtk-2.4.11-r200/image/usr/bin/jsc-1 with scanelf
 * XATTR_PAX marking -me /var/tmp/portage/net-libs/webkit-gtk-2.4.11-r200/image/usr/bin/jsc-1 with setfattr
 * Final size of build directory: 749792 KiB (732.2 MiB)
 * Final size of installed tree:   56964 KiB ( 55.6 MiB)
>>> Auto-cleaning packages...

>>> No outdated packages were found on your system.
Comment 20 Adrian Bassett 2017-12-13 14:07:27 UTC
(In reply to N. Andrew Walsh from comment #8)
> I applied the patch from Comment #5 to webkit-gtk-2.4.11-r1, and got the
> following error:
> 
> Source/WebKit2/Shared/API/c/WKString.cpp:58:72: error: invalid static_cast
> from type ‘WKChar* {aka short unsigned int*}’ to type ‘UChar* {aka
> char16_t*}’
> 
> Is this a different issue from the one discussed here?

Yes, but it's related in that it's an invalid cast (but going the other way). I'm seeing it too.

The initial problem is addressed by applying the patch in Comment #5 according to personal preference (I installed a modified ebuild in a local overlay, put the patch in the files sub-dir, and called it explicitly from the ebuild).

This particular problem will need a different patch but I haven't been able to locate one.

The build nearly completed, as shown by the size of the log files - some 915M compared with 920M of a build against ICU 58 but then failed in the same place for me and with the error you cite.

Why it's building OK for some people I don't know.  Compiler version (I'm using gcc-7.2 as system compiler)?  Use flags (pulling in different code paths)?  Different icu (I'm on 60.1)?
Comment 21 John Covici 2017-12-13 14:35:24 UTC
I tried to compile, applying the patch, changing the ebuild to have eapply_user and I get the following error with 2.4.11-r1:

libtool: compile:  x86_64-pc-linux-gnu-g++ -DHAVE_CONFIG_H -I. -fno-strict-aliasing -DPACKAGE_LOCALE_DIR=\"/usr/share/locale\" -Wall -W -Wcast-align -Wchar-subscripts -Wreturn-type -Wformat -Wformat-security -Wno-format-y2k -Wundef -Wmissing-format-attribute -Wpointer-arith -Wwrite-strings -Wno-unused-parameter -Wno-parentheses -fno-exceptions -DBUILDING_CAIRO__ -DBUILDING_GTK__ -DBUILDING_WEBKIT2__ -include ./Source/WebKit2/WebKit2Prefix.h -I./Source/WebKit/gtk -I./Source/WebKit2 -I./Source/WebKit2/gtk -I./Source/WebKit2/NetworkProcess -I./Source/WebKit2/NetworkProcess/FileAPI -I./Source/WebKit2/Platform -I./Source/WebKit2/Platform/IPC/gtk -I./Source/WebKit2/Platform/IPC -I./Source/WebKit2/Platform/gtk -I./Source/WebKit2/PluginProcess -I./Source/WebKit2/Shared -I./Source/WebKit2/Shared/API -I./Source/WebKit2/Shared/API/c -I./Source/WebKit2/Shared/API/c/gtk -I./Source/WebKit2/Shared/API/c/soup -I./Source/WebKit2/Shared/Authentication -I./Source/WebKit2/Shared/CoreIPCSupport -I./Source/WebKit2/Shared/Downloads -I./Source/WebKit2/Shared/Downloads/soup -I./Source/WebKit2/Shared/FileAPI -I./Source/WebKit2/Shared/Databases -I./Source/WebKit2/Shared/Databases/IndexedDB -I./Source/WebKit2/Shared/gtk -I./Source/WebKit2/Shared/Network -I./Source/WebKit2/Shared/Network/CustomProtocols -I./Source/WebKit2/Shared/Network/CustomProtocols/soup -I./Source/WebKit2/Shared/Plugins -I./Source/WebKit2/Shared/Plugins/Netscape -I./Source/WebKit2/Shared/Plugins/Netscape/x11 -I./Source/WebKit2/Shared/soup -I./Source/WebKit2/UIProcess -I./Source/WebKit2/UIProcess/API -I./Source/WebKit2/UIProcess/API/C -I./Source/WebKit2/UIProcess/API/C/gtk -I./Source/WebKit2/UIProcess/API/C/soup -I./Source/WebKit2/UIProcess/API/cpp -I./Source/WebKit2/UIProcess/API/gtk -I./Source/WebKit2/UIProcess/Authentication -I./Source/WebKit2/UIProcess/Downloads -I./Source/WebKit2/UIProcess/gtk -I./Source/WebKit2/UIProcess/Launcher -I./Source/WebKit2/UIProcess/Launcher/gtk -I./Source/WebKit2/UIProcess/Network -I./Source/WebKit2/UIProcess/Network/CustomProtocols -I./Source/WebKit2/UIProcess/Network/CustomProtocols/soup -I./Source/WebKit2/UIProcess/Notifications -I./Source/WebKit2/UIProcess/Plugins -I./Source/WebKit2/UIProcess/Plugins/gtk -I./Source/WebKit2/UIProcess/Plugins/unix -I./Source/WebKit2/UIProcess/Storage -I./Source/WebKit2/UIProcess/soup -I./Source/WebKit2/UIProcess/InspectorServer -I./Source/WebKit2/WebProcess -I./Source/WebKit2/WebProcess/ApplicationCache -I./Source/WebKit2/WebProcess/Battery -I./Source/WebKit2/WebProcess/Cookies -I./Source/WebKit2/WebProcess/Databases -I./Source/WebKit2/WebProcess/Databases/IndexedDB -I./Source/WebKit2/WebProcess/FileAPI -I./Source/WebKit2/WebProcess/FullScreen -I./Source/WebKit2/WebProcess/Geolocation -I./Source/WebKit2/WebProcess/gtk -I./Source/WebKit2/WebProcess/IconDatabase -I./Source/WebKit2/WebProcess/InjectedBundle -I./Source/WebKit2/WebProcess/InjectedBundle/API -I./Source/WebKit2/WebProcess/InjectedBundle/API/c -I./Source/WebKit2/WebProcess/InjectedBundle/API/gtk -I./Source/WebKit2/WebProcess/InjectedBundle/DOM -I./Source/WebKit2/WebProcess/InjectedBundle/gtk -I./Source/WebKit2/WebProcess/KeyValueStorage -I./Source/WebKit2/WebProcess/Launching -I./Source/WebKit2/WebProcess/MediaCache -I./Source/WebKit2/WebProcess/Network -I./Source/WebKit2/WebProcess/NetworkInfo -I./Source/WebKit2/WebProcess/Notifications -I./Source/WebKit2/WebProcess/OriginData -I./Source/WebKit2/WebProcess/ResourceCache -I./Source/WebKit2/WebProcess/Storage -I./Source/WebKit2/WebProcess/soup -I./Source/WebKit2/WebProcess/Plugins -I./Source/WebKit2/WebProcess/Plugins/Netscape -I./Source/WebKit2/WebProcess/Plugins/Netscape/unix -I./Source/WebKit2/WebProcess/WebCoreSupport -I./Source/WebKit2/WebProcess/WebCoreSupport/gtk -I./Source/WebKit2/WebProcess/WebCoreSupport/soup -I./Source/WebKit2/WebProcess/WebPage -I./Source/WebKit2/WebProcess/WebPage/atk -I./Source/WebKit2/WebProcess/WebPage/gtk -I./DerivedSources/WebKit2 -I./DerivedSources/WebKit2/include -I./DerivedSources/WebKit2/webkit2gtk -I./DerivedSources/WebKit2/webkit2gtk/include -I./DerivedSources/WebKit2/webkit2gtk/webkit2 -I./DerivedSources/WebKit2/webkit2extension/include -I./DerivedSources/WebKit2/include/JavaScriptCore -I./DerivedSources/WebKit2/include/WebCore -I./DerivedSources/WebKit2/include/WebKit2 -I./DerivedSources/webkitdom -DLIBEXECDIR=\"/usr/libexec\" -DLIBDIR=\"/usr/lib64\" -DBUILDING_WEBKIT -DWEBKIT2_COMPILATION -DENABLE_PLUGIN_PROCESS=1 -I./Source/ThirdParty/ANGLE/src -I./Source/ThirdParty/ANGLE/include -I./Source/ThirdParty/ANGLE/include/GLSLANG -I./Source/ThirdParty/ANGLE/include/KHR -I./DerivedSources/Platform -DWEBKITGTK_API_VERSION_STRING=\"3.0\" -DDATA_DIR=\"/usr/share\" -I./Source/ThirdParty/ANGLE/src -I./Source/ThirdParty/ANGLE/include -I./Source/ThirdParty/ANGLE/include/GLSLANG -I./Source/ThirdParty/ANGLE/include/KHR -I./Source/WebCore -I./Source/WebCore/Modules/battery -I./Source/WebCore/Modules/gamepad -I./Source/WebCore/Modules/geolocation -I./Source/WebCore/Modules/indexeddb -I./Source/WebCore/Modules/indexeddb/leveldb -I./Source/WebCore/Modules/indieui -I./Source/WebCore/Modules/mediasource -I./Source/WebCore/Modules/mediastream -I./Source/WebCore/Modules/navigatorcontentutils -I./Source/WebCore/Modules/notifications -I./Source/WebCore/Modules/plugins -I./Source/WebCore/Modules/proximity -I./Source/WebCore/Modules/quota -I./Source/WebCore/Modules/webaudio -I./Source/WebCore/Modules/webdatabase -I./Source/WebCore/Modules/websockets -I./Source/WebCore/accessibility -I./Source/WebCore/bindings -I./Source/WebCore/bindings/generic -I./Source/WebCore/bindings/js -I./Source/WebCore/bridge -I./Source/WebCore/bridge/c -I./Source/WebCore/bridge/jsc -I./Source/WebCore/crypto -I./Source/WebCore/crypto/keys -I./Source/WebCore/css -I./Source/WebCore/cssjit -I./Source/WebCore/dom -I./Source/WebCore/dom/default -I./Source/WebCore/editing -I./Source/WebCore/fileapi -I./Source/WebCore/history -I./Source/WebCore/html -I./Source/WebCore/html/canvas -I./Source/WebCore/html/forms -I./Source/WebCore/html/parser -I./Source/WebCore/html/shadow -I./Source/WebCore/html/track -I./Source/WebCore/inspector -I./Source/WebCore/loader -I./Source/WebCore/loader/appcache -I./Source/WebCore/loader/archive -I./Source/WebCore/loader/archive/mhtml -I./Source/WebCore/loader/cache -I./Source/WebCore/loader/icon -I./Source/WebCore/mathml -I./Source/WebCore/page -I./Source/WebCore/page/animation -I./Source/WebCore/page/scrolling -I./Source/WebCore/platform -I./Source/WebCore/platform/animation -I./Source/WebCore/platform/audio -I./Source/WebCore/platform/graphics -I./Source/WebCore/platform/graphics/cpu/arm -I./Source/WebCore/platform/graphics/cpu/arm/filters/ -I./Source/WebCore/platform/graphics/filters -I./Source/WebCore/platform/graphics/filters/texmap -I./Source/WebCore/platform/graphics/freetype -I./Source/WebCore/platform/graphics/gpu -I./Source/WebCore/platform/graphics/harfbuzz -I./Source/WebCore/platform/graphics/harfbuzz/ng -I./Source/WebCore/platform/graphics/opengl -I./Source/WebCore/platform/graphics/opentype -I./Source/WebCore/platform/graphics/transforms -I./Source/WebCore/platform/image-decoders -I./Source/WebCore/platform/image-decoders/bmp -I./Source/WebCore/platform/image-decoders/gif -I./Source/WebCore/platform/image-decoders/ico -I./Source/WebCore/platform/image-decoders/jpeg -I./Source/WebCore/platform/image-decoders/png -I./Source/WebCore/platform/image-decoders/webp -I./Source/WebCore/platform/leveldb -I./Source/WebCore/platform/linux -I./Source/WebCore/platform/mediastream -I./Source/WebCore/platform/mediastream/gstreamer -I./Source/WebCore/platform/mock -I./Source/WebCore/platform/mock/mediasource -I./Source/WebCore/platform/network -I./Source/WebCore/platform/network/gtk -I./Source/WebCore/platform/sql -I./Source/WebCore/platform/text -I./Source/WebCore/platform/text/icu -I./Source/WebCore/platform/win -I./Source/WebCore/plugins -I./Source/WebCore/plugins/win -I./Source/WebCore/rendering -I./Source/WebCore/rendering/line -I./Source/WebCore/rendering/mathml -I./Source/WebCore/rendering/shapes -I./Source/WebCore/rendering/style -I./Source/WebCore/rendering/svg -I./Source/WebCore/storage -I./Source/WebCore/style -I./Source/WebCore/svg -I./Source/WebCore/svg/animation -I./Source/WebCore/svg/graphics -I./Source/WebCore/svg/graphics/filters -I./Source/WebCore/svg/properties -I./Source/WebCore/testing -I./Source/WebCore/testing/js -I./Source/WebCore/websockets -I./Source/WebCore/workers -I./Source/WebCore/xml -I./Source/WebCore/xml/parser -I./WebCore/bindings/js -I./DerivedSources/WebCore -I./DerivedSources -I./DerivedSources/JavaScriptCore -I./Source/WebCore/platform/graphics/texmap -DWEBKITGTK_API_VERSION_STRING=\"3.0\" -I./Source/WebCore/accessibility/atk -I./Source/WebCore/loader/gtk -I./Source/WebCore/page/gtk -I./Source/WebCore/platform/cairo -I./Source/WebCore/platform/audio/gstreamer -I./Source/WebCore/platform/graphics/cairo -I./Source/WebCore/platform/graphics/freetype -I./Source/WebCore/platform/graphics/glx -I./Source/WebCore/platform/graphics/harfbuzz -I./Source/WebCore/platform/graphics/harfbuzz/ng -I./Source/WebCore/platform/graphics/egl -I./Source/WebCore/platform/graphics/gstreamer -I./Source/WebCore/platform/graphics/gtk -I./Source/WebCore/platform/gtk -I./Source/WebCore/platform/mediastream/gstreamer -I./Source/WebCore/platform/network/soup -I./Source/WebCore/platform/text/enchant -I./Source -I./Source/JavaScriptCore -I./Source/JavaScriptCore/API -I./Source/JavaScriptCore/ForwardingHeaders -I./Source/JavaScriptCore/assembler -I./Source/JavaScriptCore/bindings -I./Source/JavaScriptCore/bytecode -I./Source/JavaScriptCore/bytecompiler -I./Source/JavaScriptCore/debugger -I./Source/JavaScriptCore/dfg -I./Source/JavaScriptCore/disassembler -I./Source/JavaScriptCore/ftl -I./Source/JavaScriptCore/heap -I./Source/JavaScriptCore/inspector -I./Source/JavaScriptCore/inspector/agents -I./Source/JavaScriptCore/interpreter -I./Source/JavaScriptCore/jit -I./Source/JavaScriptCore/llint -I./Source/JavaScriptCore/parser -I./Source/JavaScriptCore/profiler -I./Source/JavaScriptCore/runtime -I./Source/JavaScriptCore/tools -I./Source/JavaScriptCore/yarr -I./DerivedSources/JavaScriptCore -I./Source/WTF -fno-omit-frame-pointer -fno-tree-dce -pthread -I/usr/include/enchant -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/libdrm -I/usr/include/libpng16 -I/usr/include/freetype2 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -pthread -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -pthread -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -pthread -I/usr/include/gtk-3.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libdrm -I/usr/include/libpng16 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng16 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -pthread -I/usr/include/gtk-3.0/unix-print -I/usr/include/gtk-3.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libdrm -I/usr/include/libpng16 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng16 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -pthread -I/usr/include/libsoup-2.4 -I/usr/include/libxml2 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include -fno-rtti -O2 -mtune=core2 -pipe -g -pthread -std=c++11 -Wno-c++11-compat -MT Source/WebKit2/Shared/API/c/libwebkit2gtk_3_0_la-WKString.lo -MD -MP -MF Source/WebKit2/Shared/API/c/.deps/libwebkit2gtk_3_0_la-WKString.Tpo -c Source/WebKit2/Shared/API/c/WKString.cpp  -fPIC -DPIC -o Source/WebKit2/Shared/API/c/.libs/libwebkit2gtk_3_0_la-WKString.o
Source/WebKit2/Shared/API/c/WKString.cpp: In function ΓÇÿsize_t WKStringGetCharacters(WKStringRef, WKChar*, size_t)ΓÇÖ:
Source/WebKit2/Shared/API/c/WKString.cpp:58:72: error: invalid static_cast from type ΓÇÿWKChar* {aka short unsigned int*}ΓÇÖ to type ΓÇÿUChar* {aka char16_t*}ΓÇÖ
     return (toImpl(stringRef)->getCharacters(static_cast<UChar*>(buffer), bufferLength));
                                                                        ^
make[1]: *** [GNUmakefile:73633: Source/WebKit2/Shared/API/c/libwebkit2gtk_3_0_la-WKString.lo] Error 1
Comment 22 John Covici 2017-12-13 14:38:31 UTC
I am using gcc 6.4 and icu 6.0x.
Comment 23 Adrian Bassett 2017-12-13 15:14:51 UTC
(In reply to John Covici from comment #21)
> I tried to compile, applying the patch, changing the ebuild to have
> eapply_user and I get the following error with 2.4.11-r1:

...
 
> WKStringGetCharacters(WKStringRef, WKChar*, size_t)ΓÇÖ:
> Source/WebKit2/Shared/API/c/WKString.cpp:58:72: error: invalid static_cast
> from type ΓÇÿWKChar* {aka short unsigned int*}ΓÇÖ to type ΓÇÿUChar* {aka
> char16_t*}ΓÇÖ
>      return (toImpl(stringRef)->getCharacters(static_cast<UChar*>(buffer),
> bufferLength));
>                                                                         ^
> make[1]: *** [GNUmakefile:73633:
> Source/WebKit2/Shared/API/c/libwebkit2gtk_3_0_la-WKString.lo] Error 1

This is the same as comment 8 and comment 20, so can now be assumed confirmed.
Comment 24 Adrian Bassett 2017-12-13 15:25:54 UTC
It's perhaps worth pointing out that the various versions of webkit-gtk do occupy different slots:

# grep SLOT /usr/portage/net-libs/webkit-gtk/*ebuild

webkit-gtk-2.18.3.ebuild:SLOT="4/37" # soname version of libwebkit2gtk-4.0
webkit-gtk-2.4.11-r1.ebuild:SLOT="3/25" # soname version of libwebkit2gtk-3.0
webkit-gtk-2.4.11-r200.ebuild:SLOT="2" # no usable subslot

so if you are using eapply_user and are also encoding the slot number in the path for the patch under /etc/portage/patches, e.g. as per the path in comment 10, then you do need to match the slot number for the version of 2.4.11, either -r1 or -r200, that you are tyring to build: :3 for 2.4.11-r1 and :2 for 2.4.11-r200.  This is not an encoding that I had previously encountered ...
Comment 25 Fred Krogh 2017-12-13 17:16:34 UTC
I guess I'm the only one that can not get this to work.  I have the patch file in /etc/portage/patches/net-libs/webkit-gtk:2.  I have placed the line
    eapply_user
just before the closing '}' of the src_prepare() { section in the build file.  From the /usr/portage/netlibs/webkit-gtk I have run
ebuild webkit-gtk-2.4.11-r200.ebuild  digest
emerge -1 =webkit-gtk-2.4.11-r200
In the resulting build.log I see no record of the patch being applied, but don't know if that means it wasn't.  What is clear is that it did not succeed.  These problems started after a switch to profile 17.0.  I'm compiling with gcc-7.2.0 and have icu-60.2.  Is there something obvious I'm missing?  Thanks.
Comment 26 Denis Descheneaux 2017-12-13 17:18:00 UTC
user patch into: /etc/portage/patches/netlib/webkit-gtk:2

and named the patch: backported-621532.patch

which is related all to my comment 19
Comment 27 Denis Descheneaux 2017-12-13 17:20:37 UTC
(In reply to Fred Krogh from comment #25)
> I guess I'm the only one that can not get this to work.  I have the patch
> file in /etc/portage/patches/net-libs/webkit-gtk:2.  I have placed the line
>     eapply_user
> just before the closing '}' of the src_prepare() { section in the build
> file.  From the /usr/portage/netlibs/webkit-gtk I have run
> ebuild webkit-gtk-2.4.11-r200.ebuild  digest
> emerge -1 =webkit-gtk-2.4.11-r200
> In the resulting build.log I see no record of the patch being applied, but
> don't know if that means it wasn't.  What is clear is that it did not
> succeed.  These problems started after a switch to profile 17.0.  I'm
> compiling with gcc-7.2.0 and have icu-60.2.  Is there something obvious I'm
> missing?  Thanks.

You should defitively see it comment 19 or extract from it below:

 * Applying backported-621532.patch ...
 * User patches applied.
Comment 28 Denis Descheneaux 2017-12-13 17:24:31 UTC
this is where i put in the eapply_user

in ebuild: /etc/portage/local/net-libs/webkit-gtk/webkit-gtk-2.4.11-r200.ebuild

or if you copy the tree locally and modify in your own overlay

	# https://bugs.webkit.org/show_bug.cgi?id=159124#c1
	eapply "${FILESDIR}"/${PN}-2.4.9-gcc-6.patch
+	eapply_user
	AT_M4DIR=Source/autotools eautoreconf

	gnome2_src_prepare
}
Comment 29 Fred Krogh 2017-12-13 18:31:15 UTC
I finally have this emerged.  My patch file did not have an extension of ".patch".  Once that was corrected, what I wrote in comment 25 works for me.
Comment 30 Adrian Bassett 2017-12-13 21:00:37 UTC
(In reply to Adrian.Bassett from comment #20)
> (In reply to N. Andrew Walsh from comment #8)
> > I applied the patch from Comment #5 to webkit-gtk-2.4.11-r1, and got the
> > following error:
> > 
> > Source/WebKit2/Shared/API/c/WKString.cpp:58:72: error: invalid static_cast
> > from type ‘WKChar* {aka short unsigned int*}’ to type ‘UChar* {aka
> > char16_t*}’
> > 
> > Is this a different issue from the one discussed here?
> 
> Yes, but it's related in that it's an invalid cast (but going the other
> way). I'm seeing it too.

And, in a sense, more to the point, is relevant only to webkit-gtk-2.4.11-r1 and not webkit-gtk-2.4.11-r200 (which is the focus of this particular bug).  The latter now builds for me OK with the patch from comment #5.  Arguably a separate bug should be opened to track webkit-gtk-2.4.11-r1 which requires both the referred-to patch and a fix for the issue originally raised in comment 8.
Comment 31 Leonardo Ferraguzzi 2017-12-17 23:02:51 UTC
Created attachment 510560 [details, diff]
webkit-gtk-2.4.11-r1 static_cast patch

Attached patch should fix the following webkit-gtk-2.4.11-r1 build error:

Source/WebKit2/Shared/API/c/WKString.cpp:58:72: error: invalid static_cast from type ‘WKChar* {aka short unsigned int*}’ to type ‘UChar* {aka char16_t*}’

follow the same instructions in comment 28 also for webkit-gtk-2.4.11-r1.ebuild, and copy the patch to:

/etc/portage/patches/net-libs/webkit-gtk:3
Comment 32 Leonardo Ferraguzzi 2017-12-17 23:29:13 UTC
Created attachment 510564 [details, diff]
webkit-gtk-2.4.11-r1 static_cast patch
Comment 33 Adrian Bassett 2017-12-18 15:45:39 UTC
(In reply to Leonardo Ferraguzzi from comment #32)
> Created attachment 510564 [details, diff] [details, diff]
> webkit-gtk-2.4.11-r1 static_cast patch
Confirm that this patch (in addition to the earlier one in comment #5) enables building webkit-gtk-2.4.11-r1 on ~amd64, gcc-7.2.0, on the 17.0 profile.
Comment 34 Andreas Sturmlechner gentoo-dev 2017-12-19 23:20:38 UTC
*** Bug 641772 has been marked as a duplicate of this bug. ***
Comment 35 Andreas Sturmlechner gentoo-dev 2017-12-19 23:52:34 UTC
*** Bug 639866 has been marked as a duplicate of this bug. ***
Comment 36 Ervin Peters 2017-12-21 08:15:36 UTC
Created attachment 511302 [details, diff]
webkit-gtk-2.4.11-WKString-typedef
Comment 37 Ervin Peters 2017-12-21 08:17:57 UTC
Created attachment 511304 [details, diff]
webkit-gtk-JSStringRef-typedef.patch

I got those through those issues too. It is cause by differnet implementatios of wchar and the workarounds.

But I took a closer look at the JSString error and found the same Sequenz in JSString.h as in WKString.h SO I applied the same changes and webkit-gtk-2.4.11 compiles with gcc-6.4.0 on a mostly stable system.

I'll attach the patches and ebuilds I used.

ervin
Comment 38 Ervin Peters 2017-12-21 08:19:53 UTC
Created attachment 511306 [details]
webkit-gtk-2.4.11-r2.ebuild

the slot 3 ebuild, I didn't changed stable to unstable, just inserted the patch lines.
Comment 39 Ervin Peters 2017-12-21 08:21:06 UTC
Created attachment 511308 [details]
webkit-gtk-2.4.11-r201.ebuild

Also, took the r200 ebuild and inserted the patch lines.
Comment 40 Rafał Mużyło 2017-12-24 00:31:28 UTC
*** Bug 642122 has been marked as a duplicate of this bug. ***
Comment 41 Rafał Mużyło 2017-12-24 01:10:46 UTC
Given the line in the initial patch (comment #3):

COMPILE_ASSERT(sizeof(WKChar) == sizeof(UChar), WKStringGetCharacters_sizeof_WKChar_matches_UChar);

the solution proposed in comment #37 is a proper one, though one, that would make >=dev-libs/icu-59 a dep...

I wonder if a result still valid for earlier versions could be achieved via '<unicode/umachine.h> and UChar, after all, both JSChar and WKChar seem to be copies of it.
Comment 42 Guy 2018-01-03 13:20:23 UTC
TL:DR - Works for me.

---o---

Performed "emaint --auto sync" to ensure latest version of gentoo tree.

Copied /usr/portage/net-libs/webkit-gtk/ to /usr/local/portage/net-libs/webkit-gtk

verified icu version

[I] dev-libs/icu
     Installed versions:  60.2(0/60.2){tbz2}(04:35:03 PM 12/31/2017)(-debug -doc -examples -static-libs ABI_MIPS="-n32 -n64 -o32" ABI_PPC="-32 -64" ABI_S390="-32 -64" ABI_X86="32 64 -x32")

Added patch files from comment #36 and comment #37
-rw-r--r-- 1 root root  527 Jan  3 07:43 webkit-gtk-2.4.11-JSStringRef-typedef.patch
-rw-r--r-- 1 root root  589 Jan  3 07:42 webkit-gtk-2.4.11-WKString-typedef.patch

Manually patched ebuilds as per comment #38 and comment #39
-rw-r--r-- 1 root root 9149 Jan  3 07:44 webkit-gtk-2.4.11-r1.ebuild
-rw-r--r-- 1 root root 8535 Jan  3 07:39 webkit-gtk-2.4.11-r200.ebuild

        # Fix build with recent icu, bug #651532
        eapply "${FILESDIR}"/${PN}-2.4.11-WKString-typedef.patch
        eapply "${FILESDIR}"/${PN}-2.4.11-JSStringRef-typedef.patch

I'm currently migrating from profile 13.0 to profile 17.0 and needed this to continue.
Comment 43 Renich Bon Ciric 2018-01-04 18:00:35 UTC
Here's what I did:

# cat /etc/portage/patches/net-libs/webkit-gtk/javascript_core_fix.patch 
--- webkitgtk-2.4.11.orig/Source/JavaScriptCore/API/JSStringRef.h	2016-04-10 08:48:36.000000000 +0200
+++ webkitgtk-2.4.11/Source/JavaScriptCore/API/JSStringRef.h	2017-12-20 23:04:55.000000000 +0100
@@ -27,6 +27,7 @@
 #define JSStringRef_h

 #include <JavaScriptCore/JSValueRef.h>
+#include <uchar.h>

 #ifndef __cplusplus
 #include <stdbool.h>
@@ -43,7 +44,7 @@
 @typedef JSChar
 @abstract A Unicode character.
 */
-    typedef unsigned short JSChar;
+    typedef char16_t JSChar;
 #else
     typedef wchar_t JSChar;
 #endif


# emaint -A sync
# emerge net-libs/webkit-gtk
Comment 44 Joakim Tjernlund 2018-01-08 19:06:36 UTC
Added: webkit-gtk-2.4.11-WKString-typedef and webkit-gtk-JSStringRef-typedef.patch
and built webkit-gtk-2.4.11-r1, got a bunch of errors:
DerivedSources/WebCore/MathMLNames.cpp:642:5: error: ‘StaticASCIILit80’ is not a member of ‘WTF::StringImpl’
     StringImpl::StaticASCIILit80 << StringImpl::StaticASCIILiteral::s_hashShift)
     ^~~~~~~~~~
DerivedSources/WebCore/MathMLNames.cpp:642:80: error: expected ‘}’ before ‘)’ token
     StringImpl::StaticASCIILit80 << StringImpl::StaticASCIILiteral::s_hashShift)
                                                                                ^
DerivedSources/WebCore/MathMLNames.cpp:642:80: error: expected ‘,’ or ‘;’ before ‘)’ token
DerivedSources/WebCore/MathMLNames.cpp:647:5: error: ‘subscriptshiftString8’ was not declared in this scope
     subscriptshiftString8,
     ^~~~~~~~~~~~~~~~~~~~~
DerivedSources/WebCore/MathMLNames.cpp:647:5: note: suggested alternative:
DerivedSources/WebCore/MathMLNames.cpp:94:20: note:   ‘WebCore::MathMLNames::subscriptshiftString8’
 static const LChar subscriptshiftString8[] = "subscriptshift";
                    ^~~~~~~~~~~~~~~~~~~~~
DerivedSources/WebCore/MathMLNames.cpp:654:5: error: ‘superscriptshiftString8’ was not declared in this scope
     superscriptshiftString8,
     ^~~~~~~~~~~~~~~~~~~~~~~
DerivedSources/WebCore/MathMLNames.cpp:654:5: note: suggested alternative:
DerivedSources/WebCore/MathMLNames.cpp:102:20: note:   ‘WebCore::MathMLNames::superscriptshiftString8’
 static const LChar superscriptshiftString8[] = "superscriptshift";
                    ^~~~~~~~~~~~~~~~~~~~~~~
DerivedSources/WebCore/MathMLNames.cpp: In function ‘void WebCore::init()’:
DerivedSources/WebCore/MathMLNames.cpp:844:27: error: ‘mathmlNamespaceURI’ was not declared in this scope
     new (NotNull, (void*)&mathmlNamespaceURI) AtomicString(mathmlNS);
                           ^~~~~~~~~~~~~~~~~~
DerivedSources/WebCore/MathMLNames.cpp:844:27: note: suggested alternative:
In file included from DerivedSources/WebCore/MathMLNames.cpp:40:0:
DerivedSources/WebCore/MathMLNames.cpp:47:29: note:   ‘WebCore::MathMLNames::mathmlNamespaceURI’
 DEFINE_GLOBAL(AtomicString, mathmlNamespaceURI)
                             ^
./Source/WTF/wtf/StaticConstructors.h:61:12: note: in definition of macro ‘DEFINE_GLOBAL’
     void * name[(sizeof(type) + sizeof(void *) - 1) / sizeof(void *)];
            ^~~~
DerivedSources/WebCore/MathMLNames.cpp:932:66: error: ‘annotationData’ was not declared in this scope
         { (void*)&annotationTag, *reinterpret_cast<StringImpl*>(&annotationData) },
                                                                  ^~~~~~~~~~~~~~
DerivedSources/WebCore/MathMLNames.cpp:932:66: note: suggested alternative:
DerivedSources/WebCore/MathMLNames.cpp:161:39: note:   ‘WebCore::MathMLNames::annotationData’
 static StringImpl::StaticASCIILiteral annotationData = {
.......
Did I mess up something ?
Comment 45 Mart Raudsepp gentoo-dev 2018-01-08 19:12:32 UTC
Apparently this is a different bug than I thought, so I thought I had already commented here, but looks like no.

So, webkit-gtk-2.4 has over 300-400 security bugs and shouldn't be installed. I realize that some packages are still lagging behind and haven't been updated away from it, but that's where I've spent some efforts in, instead of fixing 2.4 build.

If you already found this bug, your time is probably also better spent by looking what it takes to remove webkit-gtk-2.4 from your system, instead of trying to fix this years old unmaintained version.
If needed, I might be able to help in that direction, but absolutely no-one here (afaics) has mentioned why exactly they need webkit-gtk-2.4 rebuilt instead of removed, so I don't know.
Comment 46 Fred Krogh 2018-01-08 19:26:38 UTC
From this

#equery d webkit-gtk-2.4.11-r200
 * These packages depend on webkit-gtk-2.4.11-r200:
app-editors/emacs-25.3 (xwidgets ? net-libs/webkit-gtk:3)
app-office/gnucash-2.6.19 (>=net-libs/webkit-gtk-1.2:2)
app-text/atril-1.18.0 (epub ? >=net-libs/webkit-gtk-2.4.3:4)
gnome-extra/evolution-data-server-3.24.6 (google ? >=net-libs/webkit-gtk-2.11.91:4)
gnome-extra/yelp-3.22.0 (>=net-libs/webkit-gtk-2.7.2:4)
gnome-extra/zenity-3.24.0 (webkit ? >=net-libs/webkit-gtk-2.8.1:4)
net-im/empathy-3.12.14 (>=net-libs/webkit-gtk-2.10:4)
net-libs/gnome-online-accounts-3.24.4 (>=net-libs/webkit-gtk-2.7.2:4)
net-libs/libproxy-0.4.13-r2 (webkit ? net-libs/webkit-gtk:4)

I thought I no longer needed webkit-gtk-2.4.11-r100, but after unmerging it,
an emerge @preserved-rebuild, wants to bring it in.  Could someone identify the culprits and perhaps suggest what is necessary to get rid of webkit-gtk-2.4.11-r200.
Comment 47 Arve Barsnes 2018-01-08 19:29:37 UTC
Only app-office/gnucash in that list, the others require a different slot.
Comment 48 Fred Krogh 2018-01-08 19:40:28 UTC
I'd appreciate a better understanding here.  Gnucash seems to say >=, so I guess it has to do with the :2 there.  Whereas :3 and :4 are o.k.  I'm not clear on these slots.   I gather this means that I'm going to need webkit-gtk-2.4.11-r200 as long as I want gnucash.
Comment 49 Mart Raudsepp gentoo-dev 2018-01-08 19:41:17 UTC
gnucash is bug 629114. 2.7.3 release in an overlay uses security safe and working webkit-gtk:4, but involves a data migration (so you can't go back without a backup). This should be added to main tree soon.
Comment 50 Martin von Gagern 2018-01-08 21:24:50 UTC
Wouldn't it make sense to have a tracker for things that depend on outdated versions of webkit-gtk, either directly or via some USE flag on some other package?

Personally I'm currently looking at sci-misc/boinc[X] which depends on x11-libs/wxGTK:3.0-gtk3[X,opengl,webkit] and then on net-libs/webkit-gtk:3.
Comment 51 Mart Raudsepp gentoo-dev 2018-01-08 21:55:02 UTC
(In reply to Martin von Gagern from comment #50)
> Wouldn't it make sense to have a tracker for things that depend on outdated
> versions of webkit-gtk, either directly or via some USE flag on some other
> package?

bug 577068 has been tracking this for over a year.

> Personally I'm currently looking at sci-misc/boinc[X] which depends on
> x11-libs/wxGTK:3.0-gtk3[X,opengl,webkit] and then on net-libs/webkit-gtk:3.

sci-misc/boinc[X] does not depend on webkit-gtk:3 anymore in ~arch. Needs ~arch wxGTK:3.0-gtk3 for now to use webkit-gtk:4 instead. Stabilization for this new version will be requested soon.
Comment 52 Dale 2018-01-09 00:55:30 UTC
(In reply to Mart Raudsepp from comment #45)

> If you already found this bug, your time is probably also better spent by
> looking what it takes to remove webkit-gtk-2.4 from your system, instead of
> trying to fix this years old unmaintained version.
> If needed, I might be able to help in that direction, but absolutely no-one
> here (afaics) has mentioned why exactly they need webkit-gtk-2.4 rebuilt
> instead of removed, so I don't know.

If it helps anyone, I disabled the webkit USE flag and after a rebuild of the affected packages, I was able to depclean webkit-gtk for both versions, 2.18.3 and 2.4.11-r200.  This may not work for everyone but hopefully it will help someone.  

Thanks to the dev who is trying to fix this.
Comment 53 Mart Raudsepp gentoo-dev 2018-01-17 18:55:51 UTC
*** Bug 644874 has been marked as a duplicate of this bug. ***
Comment 54 Tony Vroon gentoo-dev 2018-02-05 09:43:50 UTC
(In reply to Ervin Peters from comment #37)
> I got those through those issues too. It is cause by differnet
> implementatios of wchar and the workarounds.
> But I took a closer look at the JSString error and found the same Sequenz in
> JSString.h as in WKString.h SO I applied the same changes and
> webkit-gtk-2.4.11 compiles with gcc-6.4.0 on a mostly stable system.

Thank you Ervin; I used your patches to fix the PhantomJS build.
Comment 55 Jeroen Roovers gentoo-dev 2018-02-05 17:10:16 UTC
*** Bug 646654 has been marked as a duplicate of this bug. ***
Comment 56 Pablo Yanez Trujillo 2018-02-06 02:32:10 UTC
I have the same issue when building =webkit-gtk-2.4.11-r1.

I've applied the patch (backported patch uploaded by Andreas) and it seems to work.

I'm compiling with sys-devel/gcc-6.4.0-r1::gentoo

my emerge --info

Portage 2.3.19 (python 2.7.14-final-0, default/linux/amd64/17.0/desktop, gcc-6.4.0, glibc-2.25-r9, 4.14.8-gentoo-r1 x86_64)
=================================================================
System uname: Linux-4.14.8-gentoo-r1-x86_64-Intel-R-_Core-TM-_i7-3770K_CPU_@_3.50GHz-with-gentoo-2.4.1
KiB Mem:    16306004 total,   3493836 free
KiB Swap:   33554428 total,  33554428 free
Timestamp of repository gentoo: Mon, 05 Feb 2018 22:00:01 +0000
Head commit of repository gentoo: 2de4f9319f2f5b931771facf08b02463f55a44d5
sh bash 4.4_p12
ld GNU ld (Gentoo 2.29.1 p3) 2.29.1
app-shells/bash:          4.4_p12::gentoo
dev-java/java-config:     2.2.0-r3::gentoo
dev-lang/perl:            5.24.3::gentoo
dev-lang/python:          2.7.14-r1::gentoo, 3.4.5-r1::gentoo, 3.5.4-r1::gentoo, 3.6.3-r1::gentoo
dev-util/cmake:           3.9.6::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.4.1-r2::gentoo
sys-apps/openrc:          0.34.11::gentoo
sys-apps/sandbox:         2.12::gentoo
sys-devel/autoconf:       2.13::gentoo, 2.69-r4::gentoo
sys-devel/automake:       1.11.6-r2::gentoo, 1.13.4-r1::gentoo, 1.15.1-r1::gentoo
sys-devel/binutils:       2.29.1-r1::gentoo
sys-devel/gcc:            4.9.4::gentoo, 5.4.0-r3::gentoo, 6.4.0-r1::gentoo
sys-devel/gcc-config:     1.8-r1::gentoo
sys-devel/libtool:        2.4.6-r3::gentoo
sys-devel/make:           4.2.1::gentoo
sys-kernel/linux-headers: 4.13::gentoo (virtual/os-headers)
sys-libs/glibc:           2.25-r9::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000
    sync-rsync-extra-opts: 

local
    location: /usr/local/portage
    masters: gentoo

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA @EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/config /usr/share/gnupg/qualified.txt /var/bind"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles keepwork merge-sync multilib-strict news parallel-fetch preserve-libs protect-owned sandbox sfperms splitdebug strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://ftp-stud.fht-esslingen.de/pub/Mirrors/gentoo/"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="en en_GB ja"
MAKEOPTS="-j9"
PKGDIR="/export/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
USE="X a52 aac acl acpi alsa amd64 bash-completion berkdb bluetooth branding bzip2 cairo cdda cdr cjk cli consolekit crypt cups cxx dbus directfb dri dts dvd dvdr emboss encode exif fam flac fortran gdbm gif glamor gpm gtk iconv ipv6 jpeg lcms ldap libnotify mad mmx mng modules mp3 mp4 mpeg multilib ncurses nls nptl ogg opengl openmp pam pango pcre pdf png policykit ppds qt3support qt5 readline sdl seccomp spell sqlite ssl startup-notification svg tcpd theora tiff truetype udev udisks unicode upower usb vim-pager vim-syntax vorbis win32codecs wxwidgets x264 xattr xcb xml xv xvid zlib" ABI_X86="64 32" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" L10N="en en_GB ja" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-6 php7-0" POSTGRES_TARGETS="postgres9_5" PYTHON_SINGLE_TARGET="python3_5" PYTHON_TARGETS="python2_7 python3_5" RUBY_TARGETS="ruby18 ruby19" USERLAND="GNU" VIDEO_CARDS="nvidia nouveau vesa fbdev nv" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 57 dieter ferdinand 2018-02-07 12:00:06 UTC
hello,
same problem with gcc 6.4 and icu 60.2:
Source/JavaScriptCore/API/JSStringRef.cpp: In function 'OpaqueJSString* JSStringCreateWithCharacters(const JSChar*, size_t)':
Source/JavaScriptCore/API/JSStringRef.cpp:40:50: error: invalid conversion from 'const JSChar* {aka const short unsigned int*}' to 'const UChar* {aka c
onst char16_t*}' [-fpermissive]
     return OpaqueJSString::create(chars, numChars).leakRef();
                                                  ^
In file included from Source/JavaScriptCore/API/JSStringRef.cpp:31:0:
Source/JavaScriptCore/API/OpaqueJSString.h:49:39: note:   initializing argument 1 of 'static WTF::PassRefPtr<OpaqueJSString> OpaqueJSString::create(con
st UChar*, unsigned int)'
     static PassRefPtr<OpaqueJSString> create(const UChar* characters, unsigned length)
                                       ^~~~~~
Source/JavaScriptCore/API/JSStringRef.cpp: In function 'OpaqueJSString* JSStringCreateWithCharactersNoCopy(const JSChar*, size_t)':
Source/JavaScriptCore/API/JSStringRef.cpp:65:83: error: invalid conversion from 'const JSChar* {aka const short unsigned int*}' to 'const UChar* {aka c
onst char16_t*}' [-fpermissive]
 queJSString::create(StringImpl::createWithoutCopying(chars, numChars)).leakRef();

i think, the problem comes with gcc 6.4 with stronger type conversion checking!                                                                     

goodby
Comment 58 dieter ferdinand 2018-02-07 13:59:12 UTC
hello,
switch back to gcc 5.4 don't help.

goodby
Comment 59 Tobias Leupold 2018-02-10 15:05:19 UTC
Very same problem here, using gcc 6.4.0-r1. Using the above patches and the -r201 ebuild, the package builds again.
Comment 60 Mart Raudsepp gentoo-dev 2018-02-16 15:10:46 UTC
Just to reiterate. There are no plans to fix this webkit-gtk ancient SLOT, because it will be last rited any day now; just waiting on gnucash-2.7 stabilization to proceed after some (probably harmless) test failures are fixed or deemed nonblocking.
Comment 61 Mart Raudsepp gentoo-dev 2018-02-23 06:09:50 UTC
This version has been package.masked, please remove these old SLOTs from your system, if you care about security at all.


# Mart Raudsepp <leio@gentoo.org> (23 Feb 2018)
# Old net-libs/webkit-gtk SLOTs have hundreds of known security issues.
# Use the security safe net-libs webkit-gtk SLOT=4 instead via
# libraries and applications ported to gtk3 and webkit2gtk API.
# Masked for removal in 30 days. Bug #577068.
# Please keep this package.mask entry until at least 25th May 2018 for
# extra notification of the security vulnerabilities.
net-libs/webkit-gtk:2
net-libs/webkit-gtk:3