镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Defining OPENSSL_THREADS in common.gypi broke my Electron native addon build #27540

Description

@murgatroid99

Change #23426 added a section to common.gypi that conditionally defines OPENSSL_THREADS. This change was integrated into Electron 5 and as a result my native addon that depends on BoringSSL under Electron now fails to build under Electron 5 with the following error message:

../deps/grpc/third_party/boringssl/include/openssl/base.h:143:0: error: "OPENSSL_THREADS" redefined [-Werror]
 #define OPENSSL_THREADS

The full bug details are at electron/electron#18122.

Activity

  1. refack commented on May 2, 2019

    @refack
    Contributor

    Hello @murgatroid99 and thank you for the report. You can un-define this macro in your binding.gyp, using GYP's exclude-from-list ! suffix:

       'defines!': [ 'OPENSSL_THREADS' ],
    

    P.S. Or follow the suggestions in electron/electron#18122 (comment)

  2. added
    addonsIssues and PRs related to native addons.
    opensslIssues and PRs related to the OpenSSL dependency.
    on May 6, 2019
  3. bnoordhuis commented on May 6, 2019

    @bnoordhuis
    Member

    I'll close this out as a workaround exists and I don't think it's a change we'll roll back. Without exporting OPENSSL_THREADS you can't use some APIs from openssl/crypto.h safely or at all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    addonsIssues and PRs related to native addons.opensslIssues and PRs related to the OpenSSL dependency.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions