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

Building Chromium for Windows x_86 #306

Open
ArtinKennedy opened this issue Oct 22, 2024 · 8 comments
Open

Building Chromium for Windows x_86 #306

ArtinKennedy opened this issue Oct 22, 2024 · 8 comments

Comments

@ArtinKennedy
Copy link

ArtinKennedy commented Oct 22, 2024

I want to build chromium for window x_86. For this, I build liboqs using this command:
cmake .. -DCMAKE_INSTALL_PREFIX=%CHROMIUM_ROOT%/third_party/boringssl/src/oqs -DOQS_USE_OPENSSL=OFF -DCMAKE_BUILD_TYPE=Release -DOQS_DIST_BUILD=OFF -DOQS_OPT_TARGET=generic

and set target_cpu = "x86" in args.gn config file. when start building of chromium, after some minutes this error occured:

[878/30595] LINK chrome_proxy.exe chrome_proxy.exe.pdb
FAILED: chrome_proxy.exe chrome_proxy.exe.pdb
....\third_party\llvm-build\Release+Asserts\bin\lld-link.exe "/OUT:./chrome_proxy.exe" /nologo -libpath:....\third_party\llvm-build\Release+Asserts\lib\clang\19\lib\windows "-libpath:C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519\ATLMFC\lib\x86" "-libpath:C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519\lib\x86" "-libpath:C:\Program Files (x86)\Windows Kits\10\lib\10.0.22621.0\ucrt\x86" "-libpath:C:\Program Files (x86)\Windows Kits\10\lib\10.0.22621.0\um\x86" /MACHINE:X86 "/PDB:./chrome_proxy.exe.pdb" "@./chrome_proxy.exe.rsp"
lld-link: error: undefined symbol: _OQS_SIG_verify

referenced by obj/third_party/boringssl\boringssl/p_oqs.obj:(_oqs_verify_sig)
referenced by obj/third_party/boringssl\boringssl/p_oqs.obj:(_pkey_oqs_verify_message)

lld-link: error: undefined symbol: _OQS_SIG_new

referenced by obj/third_party/boringssl\boringssl/p_oqs.obj:(_dilithium2_pkey_keygen)
referenced by obj/third_party/boringssl\boringssl/p_oqs.obj:(_dilithium3_pkey_keygen)
referenced by obj/third_party/boringssl\boringssl/p_oqs.obj:(_dilithium5_pkey_keygen)
referenced 77 more times

lld-link: error: undefined symbol: _OQS_SIG_keypair

referenced by obj/third_party/boringssl\boringssl/p_oqs.obj:(_dilithium2_pkey_keygen)
referenced by obj/third_party/boringssl\boringssl/p_oqs.obj:(_dilithium3_pkey_keygen)
referenced by obj/third_party/boringssl\boringssl/p_oqs.obj:(_dilithium5_pkey_keygen)
referenced 17 more times

lld-link: error: undefined symbol: _OQS_SIG_sign

referenced by obj/third_party/boringssl\boringssl/p_oqs.obj:(_pkey_oqs_sign_message)
[889/30595] CXX obj/third_party/pdfium/core/fpdfapi/page/page/cpdf_meshstream.obj
ninja: build stopped: subcommand failed.

How can I resolve this error?

@Raytonne
Copy link
Contributor

Could you share all the commands you used for the build?

The linker didn't link oqs.lib. Did you apply the Windows patch?

@pi-314159
Copy link
Member

There's an issue with the instructions.

In step 3, you have to run cd liboqs before git checkout 9aa2e1481cd0c242658ec8e92776741feabec163

@ArtinKennedy
Copy link
Author

Could you share all the commands you used for the build?

The linker didn't link oqs.lib. Did you apply the Windows patch?

Yes. I apply Windows patch. all the commands I'm using for the build are these:

cd %CHROMIUM_ROOT%
git checkout tags/124.0.6339.0
gclient sync
cd %CHROMIUM_ROOT%/third_party/boringssl/src
git remote add oqs-bssl https://github.com/open-quantum-safe/boringssl
git fetch oqs-bssl
git checkout -b oqs-bssl-master 0599bb559d3be76a98f0940d494411b6a8e0b18e
git clone https://github.com/open-quantum-safe/liboqs.git && cd liboqs && git checkout 9aa2e1481cd0c242658ec8e92776741feabec163
mkdir build && cd build
cmake .. -DCMAKE_INSTALL_PREFIX=%CHROMIUM_ROOT%/third_party/boringssl/src/oqs -DOQS_USE_OPENSSL=OFF -DCMAKE_BUILD_TYPE=Release
msbuild ALL_BUILD.vcxproj
msbuild INSTALL.vcxproj

cd %CHROMIUM_ROOT%
gn args out/Default
autoninja -C out/Default chrome

@pi-314159
Copy link
Member

I didn’t see where you applied the patch from the commands you shared.
If you have applied the patch, you shall see libs = [ "//third_party/boringssl/src/oqs/lib/oqs.lib" ] in the file third_party/boringssl/BUILD.gn

@ArtinKennedy
Copy link
Author

@pi-314159, because by applying patch file error occured, I apply that manually! and now libs = ["//third_party/boringssl/src/oqs/lib/oqs.lib" ] is in the file third_party/boringssl/BUILD.gn.

@pi-314159
Copy link
Member

@ArtinKennedy Great! Sometimes whitespace etc can cause the patch to fail. I hope you can build it successfully.

If everything works out, please remember to close this issue!

@ArtinKennedy
Copy link
Author

@pi-314159 I apply patch file. All the commands I used for the build are:

cd %CHROMIUM_ROOT%
git checkout tags/131.0.6769.0
gclient sync
cd %CHROMIUM_ROOT%/third_party/boringssl/src
git remote add oqs-bssl https://github.com/open-quantum-safe/boringssl
git fetch oqs-bssl
git checkout -b oqs-bssl-master 0599bb559d3be76a98f0940d494411b6a8e0b18e
git clone https://github.com/open-quantum-safe/liboqs.git && cd liboqs && git checkout 9aa2e1481cd0c242658ec8e92776741feabec163
mkdir build && cd build
cmake .. -DCMAKE_INSTALL_PREFIX="E:%CHROMIUM_ROOT%\third_party\boringssl\src\oqs" -DOQS_USE_OPENSSL=OFF -DCMAKE_BUILD_TYPE=Release -DOQS_DIST_BUILD=OFF -DOQS_OPT_TARGET=generic
msbuild ALL_BUILD.vcxproj
msbuild INSTALL.vcxproj
git apply oqs-Windows.patch
cd %CHROMIUM_ROOT%
gn args out/Default
append following lines to the configuration file opened in editor:

is_debug = false
symbol_level = 0
enable_nacl = false
blink_symbol_level = 0
target_cpu = "x86"
target_os = "win"

autoninja -C out/Default chrome
but errors remain:((
the command used to build liboqs for x86 is true?

@pi-314159
Copy link
Member

pi-314159 commented Nov 13, 2024

Are there any files in %CHROMIUM_ROOT%\third_party\boringssl\src\oqs? Have you applied all the modifications in the patch file?
If both answers are yes, you may want to start over and re-do the entire build process.

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

3 participants