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

Issues building openssl 3.0.0 #42

Closed
ymgeva opened this issue Oct 5, 2021 · 3 comments · Fixed by #52
Closed

Issues building openssl 3.0.0 #42

ymgeva opened this issue Oct 5, 2021 · 3 comments · Fixed by #52
Assignees
Labels
Milestone

Comments

@ymgeva
Copy link

ymgeva commented Oct 5, 2021

Trying to build openssl 3.0.0 and ran into some issue:

  1. Out of the box, the script doesn't work. Log is showing:

Undefined subroutine &main::asm called at (eval 23) line 42.
Usage: Configure [no- ...] [enable- ...] [-Dxxx] [-lxxx] [-Lxxx] [-fxxx] [-Kxxx] [no-hw-xxx|no-hw] [[no-]threads] [[no-]shared] [[no-]zlib|zlib-dynamic] [no-asm] [no-egd] [sctp] [386] [--prefix=DIR] [--openssldir=OPENSSLDIR] [--with-xxx[=vvv]] [--config=FILE] os/compiler[:flags]
pick os/compiler from:
...

Managed to work around this my removing calls to asm() from config/20-all-platforms.conf

  1. Building with bitcode doesn't work. Throwing this error:

ld: -bundle and -bitcode_bundle (Xcode setting ENABLE_BITCODE=YES) cannot be used together

Adding --disable-bitcode worked around this, but some build probably do need bitcode

@keeshux keeshux added the bug label Nov 24, 2021
@keeshux
Copy link
Member

keeshux commented Dec 1, 2021

Self note: get_openssl_version assumes trailing letter and therefore fails to generate a proper normalized string for "3.0.0" (produces "3.0.-48").

@paulocoutinhox
Copy link

paulocoutinhox commented Sep 3, 2022

Mine dont work with version 3.0.5:

file: 20-ios-sim.conf

## -*- mode: perl; -*-

my %targets = ();

%targets = (
    ## Base settings for cross-compile
    # Based on 10-main.conf: iphoneos-cross
    # Add generic compiler flags
    # Add embed-bitcode option if SDK version is 9 or higher
    "all-base" => {
        template         => 1,
        cflags           => combine('-isysroot $(CROSS_TOP)/SDKs/$(CROSS_SDK) -fno-common',
                                sub { ((!defined($ENV{'CONFIG_DISABLE_BITCODE'}) || $ENV{'CONFIG_DISABLE_BITCODE'} ne 'true') && defined($ENV{'SDKVERSION'}) && $ENV{'SDKVERSION'} =~ /^(9|[1-9][0-9]+)\./ && $disabled{shared})
                                        ? '-fembed-bitcode' : (); },
                            ),
    },

    ## Base settings
    "ios-cross-base" => {
        inherit_from    => [ "all-base" ],
        template         => 1,
        cflags           => add(sub { defined($ENV{'IOS_MIN_SDK_VERSION'}) ? '-mios-version-min=$(IOS_MIN_SDK_VERSION)' : '-mios-version-min=12.0'; }),
    },
    "macos-base" => {
        inherit_from    => [ "all-base" ],
        template         => 1,
        cflags           => add(sub { defined($ENV{'MACOS_MIN_SDK_VERSION'}) ? '-mmacosx-version-min=$(MACOS_MIN_SDK_VERSION)' : '-mmacosx-version-min=10.15'; }),
    },
    "mac-catalyst-base" => {
        inherit_from    => [ "all-base" ],
        template        => 1,
#        cflags          => add(sub { defined($ENV{'CATALYST_MIN_SDK_VERSION'}) ? '-mmacosx-version-min=$(CATALYST_MIN_SDK_VERSION)' : '-mmacosx-version-min=10.15'; }),
    },
    "watchos-cross-base" => {
        inherit_from    => [ "all-base" ],
        template         => 1,
        cflags           => add(sub { defined($ENV{'WATCH_MIN_SDK_VERSION'}) ? '-mwatchos-version-min=$(WATCH_MIN_SDK_VERSION)' : '-mwatchos-version-min=4.0'; }),
    },
    "tvos-cross-base" => {
        inherit_from    => [ "all-base" ],
        template         => 1,
        cflags           => add(sub { defined($ENV{'TVOS_MIN_SDK_VERSION'}) ? '-mtvos-version-min=$(TVOS_MIN_SDK_VERSION)' : '-mtvos-version-min=12.0'; }),
        defines          => [ "HAVE_FORK=0" ],
    },

    ## Apple iOS

    # Device
    "ios64-cross-arm64" => {
        inherit_from     => [ "darwin-common", "ios-cross-base" ],
        cflags           => add("-arch arm64"),
        bn_ops           => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
        perlasm_scheme   => "ios64",
        sys_id           => "iOS",
    },
    "ios64-cross-arm64e" => {
        inherit_from     => [ "darwin-common", "ios-cross-base" ],
        cflags           => add("-arch arm64e"),
        bn_ops           => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
        perlasm_scheme   => "ios64",
        sys_id           => "iOS",
    },
    # Simulator
    "ios-sim-cross-x86_64" => {
        inherit_from     => [ "darwin64-x86_64-cc", "ios-cross-base" ],
        sys_id           => "iOS",
    },
    "ios-sim-cross-arm64" => {
        inherit_from     => [ "darwin64-arm64-cc", "ios-cross-base" ],
        cflags           => add("-target arm64-apple-ios14.0-simulator -mios-version-min=14.0"),
        sys_id           => "iOS",
    },

    # Device
    "macos64-x86_64" => {
        inherit_from     => [ "darwin64-x86_64-cc", "macos-base" ],
        sys_id           => "MacOSX",
    },
    "macos64-arm64" => {
        inherit_from     => [ "darwin64-arm64-cc", "macos-base" ],
        sys_id           => "MacOSX",
    },
    # Catalyst
    "mac-catalyst-x86_64" => {
        inherit_from      => [ "darwin64-x86_64-cc", "mac-catalyst-base" ],
        cflags            => add("-target x86_64-apple-ios14.0-macabi -mios-version-min=14.0"),
        sys_id            => "MacOSX",
    },
    "mac-catalyst-arm64" => {
        inherit_from     => [ "darwin64-arm64-cc", "mac-catalyst-base" ],
        cflags           => add("-target arm64-apple-ios14.0-macabi -mios-version-min=14.0"),
        sys_id           => "MacOSX",
    },

    ## Apple WatchOS

    # Device
    "watchos-cross-armv7k" => {
        inherit_from     => [ "darwin-common",  "watchos-cross-base" ],
        cflags           => add("-arch armv7k -fembed-bitcode"),
        defines          => [ "HAVE_FORK=0" ],
        sys_id           => "WatchOS",
    },
    "watchos-cross-arm64_32" => {
        inherit_from     => [ "darwin-common", "watchos-cross-base"],
        cflags           => add("-arch arm64_32 -fembed-bitcode"),
        defines          => [ "HAVE_FORK=0" ],
        sys_id           => "WatchOS",
    },
    "watchos-cross-arm64" => {
        inherit_from     => [ "darwin-common", "watchos-cross-base" ],
        cflags           => add("-arch arm64 -fembed-bitcode"),
        bn_ops           => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
        perlasm_scheme   => "ios64",
        defines          => [ "HAVE_FORK=0" ],
        sys_id           => "WatchOS",
    },
    # Simulator
    "watchos-sim-cross-x86_64" => {
        inherit_from     => [ "darwin64-x86_64-cc", "watchos-cross-base"],
        cflags           => add("-fembed-bitcode"),
        defines          => [ "HAVE_FORK=0" ],
        sys_id           => "WatchOS",
    },
    "watchos-sim-cross-arm64" => {
        inherit_from     => [ "darwin64-arm64-cc", "watchos-cross-base"],
        cflags           => add("-target arm64-apple-watchos7.2-simulator -mwatchos-version-min=7.2 -fembed-bitcode"),
        defines          => [ "HAVE_FORK=0" ],
        sys_id           => "WatchOS",
    },
    "watchos-sim-cross-i386" => {
        inherit_from     => [ "darwin-common", "watchos-cross-base"],
        cflags           => add("-arch i386 -fembed-bitcode"),
        defines          => [ "HAVE_FORK=0" ],
        sys_id           => "WatchOS",
    },

    ## Apple TV

    # Device
    "tvos64-cross-arm64" => {
        inherit_from     => [ "darwin-common", "tvos-cross-base" ],
        cflags           => add("-arch arm64"),
        bn_ops           => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
        perlasm_scheme   => "ios64",
        sys_id           => "tvOS",
    },
    # Simulator
    "tvos-sim-cross-x86_64" => {
        inherit_from     => [ "darwin64-x86_64-cc", "tvos-cross-base" ],
        sys_id           => "tvOS",
    },
);

Error:

RUNNER_OS=
nasm_bin=
Install nasm failed!
./1k/build.sh: line 34: return: can only `return' from a function or sourced script
LIB_NAME=openssl
BUILD_TARGET=tvos
BUILD_ARCH=arm64
INSTALL_ROOT=install_tvos_arm64
repo=https://www.openssl.org/source/openssl-3.0.5.tar.gz
config_options_embed=no-dso no-engine no-hw
cb_tool=perl
BUILD_TARGET=tvos
BUILD_ARCH=arm64
CONFIG_TARGET=tvos-cross-arm64
CONFIG_OPTIONS=no-tests no-comp no-async no-shared no-dso no-engine no-hw
CONFIG_ALL_OPTIONS=tvos-cross-arm64 no-tests no-comp no-async no-shared no-dso no-engine no-hw --prefix=/Users/paulo/Developer/workspaces/cpp/buildware/install_tvos_arm64/openssl --openssldir=/Users/paulo/Developer/workspaces/cpp/buildware/install_tvos_arm64/openssl
***** Deprecated options: no-hw
Configuring OpenSSL version 3.0.5 for target tvos-cross-arm64
Using os-specific seed configuration
Usage: Configure [no-<cipher> ...] [enable-<cipher> ...] [-Dxxx] [-lxxx] [-Lxxx] [-fxxx] [-Kxxx] [no-hw-xxx|no-hw] [[no-]threads] [[no-]shared] [[no-]zlib|zlib-dynamic] [no-asm] [no-egd] [sctp] [386] [--prefix=DIR] [--openssldir=OPENSSLDIR] [--with-xxx[=vvv]] [--config=FILE] os/compiler[:flags]

pick os/compiler from:
BC-32 BS2000-OSD BSD-aarch64 BSD-generic32 BSD-generic64 BSD-ia64 BSD-riscv64 
BSD-sparc64 BSD-sparcv8 BSD-x86 BSD-x86-elf BSD-x86_64 Cygwin Cygwin-i386 
Cygwin-i486 Cygwin-i586 Cygwin-i686 Cygwin-x86 Cygwin-x86_64 DJGPP MPE/iX-gcc 
OS390-Unix UEFI UEFI-x86 UEFI-x86_64 UWIN VC-CE VC-WIN32 VC-WIN32-ARM 
VC-WIN32-ARM-UWP VC-WIN32-ONECORE VC-WIN32-UWP VC-WIN64-ARM VC-WIN64-ARM-UWP 
VC-WIN64A VC-WIN64A-ONECORE VC-WIN64A-UWP VC-WIN64A-masm VC-WIN64I aix-cc 
aix-gcc aix64-cc aix64-gcc aix64-gcc-as android-arm android-arm64 
android-armeabi android-mips android-mips64 android-x86 android-x86_64 
android64 android64-aarch64 android64-mips64 android64-x86_64 bsdi-elf-gcc cc 
darwin-i386 darwin-i386-cc darwin-ppc darwin-ppc-cc darwin64-arm64 
darwin64-arm64-cc darwin64-ppc darwin64-ppc-cc darwin64-x86_64 
darwin64-x86_64-cc gcc haiku-x86 haiku-x86_64 hpux-ia64-cc hpux-ia64-gcc 
hpux-parisc-cc hpux-parisc-gcc hpux-parisc1_1-cc hpux-parisc1_1-gcc 
hpux64-ia64-cc hpux64-ia64-gcc hpux64-parisc2-cc hpux64-parisc2-gcc hurd-x86 
ios-cross ios-sim-cross-arm64 ios-sim-cross-x86_64 ios-xcrun ios64-cross 
ios64-cross-arm64 ios64-cross-arm64e ios64-xcrun iossimulator-xcrun 
iphoneos-cross irix-mips3-cc irix-mips3-gcc irix64-mips4-cc irix64-mips4-gcc 
linux-aarch64 linux-alpha-gcc linux-aout linux-arm64ilp32 linux-armv4 
linux-c64xplus linux-elf linux-generic32 linux-generic64 linux-ia64 
linux-latomic linux-mips32 linux-mips64 linux-ppc linux-ppc64 linux-ppc64le 
linux-sparcv8 linux-sparcv9 linux-x32 linux-x86 linux-x86-clang linux-x86_64 
linux-x86_64-clang linux32-s390x linux64-mips64 linux64-riscv64 linux64-s390x 
linux64-sparcv9 mac-catalyst-arm64 mac-catalyst-x86_64 macos64-arm64 
macos64-x86_64 mingw mingw64 nonstop-nse nonstop-nse_64 nonstop-nse_64_put 
nonstop-nse_g nonstop-nse_g_tandem nonstop-nse_put nonstop-nse_spt 
nonstop-nse_spt_floss nonstop-nsv nonstop-nsx nonstop-nsx_64 
nonstop-nsx_64_put nonstop-nsx_g nonstop-nsx_g_tandem nonstop-nsx_put 
nonstop-nsx_spt nonstop-nsx_spt_floss sco5-cc sco5-gcc solaris-sparcv7-cc 
solaris-sparcv7-gcc solaris-sparcv8-cc solaris-sparcv8-gcc solaris-sparcv9-cc 
solaris-sparcv9-gcc solaris-x86-gcc solaris64-sparcv9-cc solaris64-sparcv9-gcc 
solaris64-x86_64-cc solaris64-x86_64-gcc tru64-alpha-cc tru64-alpha-gcc 
tvos-sim-cross-x86_64 tvos64-cross-arm64 uClinux-dist uClinux-dist64 
unixware-2.0 unixware-2.1 unixware-7 unixware-7-gcc vms-alpha vms-alpha-p32 
vms-alpha-p64 vms-ia64 vms-ia64-p32 vms-ia64-p64 vms-x86_64 vos-gcc 
vxworks-mips vxworks-ppc405 vxworks-ppc60x vxworks-ppc750 vxworks-ppc750-debug 
vxworks-ppc860 vxworks-ppcgen vxworks-simlinux watchos-cross-arm64 
watchos-cross-arm64_32 watchos-cross-armv7k watchos-sim-cross-arm64 
watchos-sim-cross-i386 watchos-sim-cross-x86_64

@keeshux
Copy link
Member

keeshux commented Sep 25, 2022

Trying to build openssl 3.0.0 and ran into some issue:

  1. Out of the box, the script doesn't work. Log is showing:

Undefined subroutine &main::asm called at (eval 23) line 42.
Usage: Configure [no- ...] [enable- ...] [-Dxxx] [-lxxx] [-Lxxx] [-fxxx] [-Kxxx] [no-hw-xxx|no-hw] [[no-]threads] [[no-]shared] [[no-]zlib|zlib-dynamic] [no-asm] [no-egd] [sctp] [386] [--prefix=DIR] [--openssldir=OPENSSLDIR] [--with-xxx[=vvv]] [--config=FILE] os/compiler[:flags]
pick os/compiler from:
...

Managed to work around this my removing calls to asm() from config/20-all-platforms.conf

  1. Building with bitcode doesn't work. Throwing this error:

ld: -bundle and -bitcode_bundle (Xcode setting ENABLE_BITCODE=YES) cannot be used together

Adding --disable-bitcode worked around this, but some build probably do need bitcode

Bitcode is deprecated:

https://developer.apple.com/documentation/xcode-release-notes/xcode-14-release-notes

So hardcoding it to false, beyond resolving the issue, would also be the way to go from now on.

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

Successfully merging a pull request may close this issue.

3 participants