Today, the preloader is linked with -fPIE in spite of the fact that the
preloader is a non-PIE statically linked binary. This is due to a
limitation in tools/makedep that makes it difficult to specify CFLAGS
for each individual object file's recipe.
This can seemingly cause problems with some GOTPCREL(X) relocations
inside the preloader. Since preloader does not link to the system
library directly, there is no need for a Global Offset Table (GOT).
However, a few extern (non-static) function symbols are declared, the
use of which makes GCC emit instructions that references those symbols
by indirection through GOT. The linker then tries to optimize such
instructions to eliminate GOT references, which can fail due to various
reasons.
This stands in contradiction with Jinoh Kang's suggestion (in bug 55050)
that "-fPIE is harmless even when applied to an object linked into
non-PIE executables." The claim is theoretically true since
position-independent code can in principle be relocated to any address
(fixed or dynamic); however, it fails due to some peculiar practical
issues, which is arguably a limitation in the linker's implementation
(since it can be worked around with -Wl,--no-relax without issues).
Fix this by eliminating GOT usage by setting the default visibility of
non-static declarations to "hidden". Assuming GCC's medium code model
(-mcmodel=medium; default code model for x86_64), this suppresses any
unnecessary PLT or GOT relocations for defined symbols, and provides
opportunity for GCC to optimize the code better.
Fixes: 78ed343842dcd8ffb95c416420953e121959d40d
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=55091
cc/ @epo
--
v3: loader: Set the visibility of symbols in preloader to "hidden".
https://gitlab.winehq.org/wine/wine/-/merge_requests/3117
Today, the preloader is linked with -fPIE in spite of the fact that the
preloader is a non-PIE statically linked binary. This is due to a
limitation in tools/makedep that makes it difficult to specify CFLAGS
for each individual object file's recipe.
This can seemingly cause problems with some GOTPCREL(X) relocations
inside the preloader. Since preloader does not link to the system
library directly, there is no need for Global Offset Tables (GOT).
However, a few extern (non-static) function symbols are declared, the
use of which makes GCC emit instructions that references those symbols
by indirection through GOT. The linker then tries to optimize such
instructions to eliminate GOT references, which can fail due to various
reasons.
This stands in contradiction with Jinoh Kang's suggestion (in bug 55050)
that "-fPIE is harmless even when applied to an object linked into
non-PIE executables." The claim is theoretically true since
position-independent code can in principle be relocated to any address
(fixed or dynamic); however, it fails due to some peculiar practical
issues, which is arguably a limitation in the linker's implementation
(since it can be worked around --no-relax without issues).
Fix this by eliminating GOT usage by setting the default visibility of
non-static declarations to "hidden". Assuming GCC's medium code model
(-mcmodel=medium; default code model for x86_64), this suppresses any
unnecessary PLT or GOT relocations for defined symbols, and provides
opportunity for GCC to optimize the code better.
Fixes: 78ed343842dcd8ffb95c416420953e121959d40d
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=55095
cc/ @epo
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3117
Some of these fixes are subtle (like the first patch) and very annoying to debug. Although the first patch looks like a hack, surprisingly, it's how the spec itself says it is! It's not even an IE quirk, but a special case in the spec.
For example, the variable name (which holds the builtin eval func) **does** matter: if it's called something other than 'eval', it gets treated differently (as if indirect), and this is verified by the tests + the spec's wording (so Microsoft's implementation follows it).
Most of the patches other than the first 2 are pretty small so they're in same MR.
--
v7: jscript: Store ref to the function code instead of the function instance
jscript: Start from the last argument when adding them to named locals.
jscript: Store detached locals into a scope's specialized buffer.
jscript: Detach the frame's scope before inserting eval() variables into it.
jscript: Don't use iface_to_jsdisp where it's not necessary to grab it.
jscript: Get rid of jsobj in scope_chain_t.
jscript: Fix function leak in scope_init_locals.
jscript: Fix addressing invalid memory if ref is an argument.
jscript: Correctly implement context for indirect eval calls in ES5+ modes.
https://gitlab.winehq.org/wine/wine/-/merge_requests/2942
Currently shell32 only transfers the plain icon for `Shell_NotifyIcon` calls, ignoring balloon icons. This patch allows transferring both images to explorer.exe tray.
--
v4: shell32: add support for balloon icon copying
shell32: refactor notify_icon for multiple icons
https://gitlab.winehq.org/wine/wine/-/merge_requests/2875
Reference
https://bugs.winehq.org/show_bug.cgi?id=54985
From the line we see the mingw version used causes an
In file included from /usr/share/mingw-w64/include/unknwnbase.h:47,
[ 935s] from /usr/share/mingw-w64/include/objidlbase.h:439,
[ 935s] from include/combaseapi.h:29,
[ 935s] from include/objbase.h:267,
[ 935s] from include/ole2.h:25,
[ 935s] from /usr/share/mingw-w64/include/wtypes.h:13,
[ 935s] from include/winscard.h:22,
[ 935s] from include/windows.h:68,
[ 935s] from libs/vkd3d/include/private/vkd3d_common.h:23,
[ 935s] from libs/vkd3d/libs/vkd3d-shader/vkd3d_shader_private.h:49,
[ 935s] from libs/vkd3d/libs/vkd3d-shader/preproc.y:24,
[ 935s] from libs/vkd3d/libs/vkd3d-shader/preproc.l:23:
[ 935s] /usr/share/mingw-w64/include/wtypesbase.h:148:16: error: redefinition of 'struct _SECURITY_ATTRIBUTES'
[ 935s] 148 | typedef struct _SECURITY_ATTRIBUTES {
The included file winscard.h seemed a little odd. The vkd3d isn't going to use this.
Adding the define WIN32_LEAN_AND_MEAN to the Makefile.in (in wine), produce the following warnings.
/home/alesliehughes/wine/libs/vkd3d/include/private/vkd3d_common.h:75:5: warning: implicit declaration of function ‘abort’ [-Wimplicit-function-declaration]
75 | abort();
| ^~~~~
/home/alesliehughes/wine/libs/vkd3d/include/private/vkd3d_common.h:258:14: warning: implicit declaration of function ‘atoi’ [-Wimplicit-function-declaration]
258 | *major = atoi(version);
Adding header <stdlib.h> removed all the warnings.
--
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/217
This MR supercedes !1895 as a solution to bug [#50771](https://bugs.winehq.org/show_bug.cgi?id=50771). Rather than fixing the problem of Wine's inability to modify the attributes of read-only files, this patch set instead implements `FILE_DISPOSITION_IGNORE_READONLY_ATTRIBUTE` which the Msys2 and Cygwin runtime libriries can use to avoid needing to modify attributes.
--
v4: ntdll: Implemented FILE_DISPOSITION_IGNORE_READONLY_ATTRIBUTE
ntdll/tests: Added tests for FILE_DISPOSITION_IGNORE_READONLY_ATTRIBUTE
ntdll: Initial implementation of FileDispositionInformationEx
include: Defined FILE_DISPOSITION_INFORMATION_EX and friends
https://gitlab.winehq.org/wine/wine/-/merge_requests/3073
Adds the tray icons implementation based on org.kde.StatusNotifierItem interface usage. Does allow restarting StatusNotifierWatcher object, but will fallback to XEMBED or internal tray, if wine gets initialized when there is no StatusNotifierWatcher object registered.
--
v23: winesni.drv: add dbus watch instead of using plain unix fds and flush
winesni.drv: replaced the dbus connection logic with a single connection per each SNI object
winesni.drv: wrap functions with pthread mutex locking
winesni.drv: implement basic balloon notification support
explorer: add winesni.drv tray implementation support
winesni.drv: add KDE StatusNotifierItem implementation for tray
https://gitlab.winehq.org/wine/wine/-/merge_requests/2808