Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No longer compiles due to googletest changes. #743

Open
AphidGit opened this issue Dec 19, 2022 · 3 comments
Open

No longer compiles due to googletest changes. #743

AphidGit opened this issue Dec 19, 2022 · 3 comments

Comments

@AphidGit
Copy link

AphidGit commented Dec 19, 2022

Issue: This no longer compiles correctly. Issue is in the imported googletest which is not version-bound. Some changes in this external code have made it incompatible with this repo's makefile/autotools thingamajig.

A test was added that does something to blow up the compiler; specifically this bit of code;

static void StackLowerThanAddress(const void* ptr,
                                  bool* result) GTEST_NO_INLINE_;
// HWAddressSanitizer add a random tag to the MSB of the local variable address,
// making comparison result unpredictable.
GTEST_ATTRIBUTE_NO_SANITIZE_HWADDRESS_
static void StackLowerThanAddress(const void* ptr, bool* result) {
  int dummy;
  *result = (&dummy < ptr);
}

// Make sure AddressSanitizer does not tamper with the stack here.
GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_
GTEST_ATTRIBUTE_NO_SANITIZE_HWADDRESS_
static bool StackGrowsDown() {
  int dummy;
  bool result;
  StackLowerThanAddress(&dummy, &result);
  return result;
}
#  endif  // GTEST_HAS_CLONE

Dummy is filled with the current stack pointer to check that the stack grows downward or upward (i.e. what do the memory addresses do, increase or decrease?). The compiler does not like this uninitialized pointer use when used with default settings including -wError=maybe-unitialized . This option needs to be turned off to compile googletest (and probably results in more errors; i.e. set -Wno-error-maybe-uninitialized). Haven't been able to test any further because autotools is so impenetrably complicated.

@AphidGit AphidGit changed the title No longer compiles. No longer compiles due to googletest changes. Dec 19, 2022
@akoeplinger
Copy link
Member

Hm this is weird since we use the submodule at a specific commit so it shouldn't suddenly change. How did you initialize the submodule? Can you show the output of git status in the repo?

@pyrates999
Copy link

pyrates999 commented Aug 9, 2023

On ubuntu 22.04 LTS, here's how I fixed it:

wget https://github.com/google/googletest/archive/refs/tags/release-1.12.1.tar.gz; \
tar xf release-1.12.1.tar.gz; \
rm -rf libgdiplus-6.1/external/googletest/*; \
cp -rfpd googletest-release-1.12.1/* host-mono/libgdiplus-6.1/external/googletest/

Releases 1.13.x and later will not work due to C++14 being required.

@mirh
Copy link

mirh commented May 25, 2024

#737
https://gitlab.winehq.org/wine-mono/libgdiplus/-/commit/10f2b16a9ff2731493a721630ae12eaf554eec4c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants