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

error: static assertion failed: Big endian requires a redesigned table #1834

Open
barracuda156 opened this issue Aug 10, 2022 · 3 comments
Open

Comments

@barracuda156
Copy link

Another error on 10.6.8 Rosetta with gcc12:

/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_folly/folly/work/folly-v2022.08.01.00/folly/detail/base64_detail/Base64SWAR.cpp: In function 'uint32_t folly::detail::base64_detail::{anonymous}::base64DecodeSWARMainLoop(const char*&, const char*, char*&)':
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_folly/folly/work/folly-v2022.08.01.00/folly/detail/base64_detail/Base64SWAR.cpp:101:14: error: static assertion failed: Big endian requires a redesigned table
  101 |       folly::kIsLittleEndian, "Big endian requires a redesigned table");
      |       ~~~~~~~^~~~~~~~~~~~~~~
@barracuda156
Copy link
Author

Source code leading to the error:

template <bool isURL>
std::uint32_t base64DecodeSWARMainLoop(
    const char*& f, const char* l, char*& o) noexcept {
  static_assert(
      folly::kIsLittleEndian, "Big endian requires a redesigned table");

  std::uint32_t errorAccumulator = 0;

  while (l - f > 4) {
    std::uint32_t r = //
        kBase64SwarDecodeTable<isURL>[0][atAsU8(f, 0)] |
        kBase64SwarDecodeTable<isURL>[1][atAsU8(f, 1)] |
        kBase64SwarDecodeTable<isURL>[2][atAsU8(f, 2)] |
        kBase64SwarDecodeTable<isURL>[3][atAsU8(f, 3)];

    errorAccumulator |= r;
    std::memcpy(o, &r, sizeof(r));

    f += 4;
    o += 3;
  }

  return errorAccumulator;
}

@barracuda156
Copy link
Author

Looks like Big Endian have been broken forever with folly: https://bytemeta.vip/repo/facebook/folly/issues/1445

@barracuda156
Copy link
Author

Now Big-endian is broken by 1110819 commit.

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

1 participant