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

Port to Plan 9 #510

Open
wants to merge 28 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
7b65390
plan9: add init-scripts for rc shell
lufia Apr 8, 2019
8cbef1a
plan9: add mkfiles into crypto
lufia Apr 8, 2019
5b8962a
plan9: fix libcrypto to compile sources with Plan 9 C dialect
lufia Apr 8, 2019
bfc4753
plan9: fix libssl to compile sources with Plan 9 C dialect
lufia Apr 8, 2019
40e2e4e
plan9: fix libtls to compile sources with Plan 9 C dialect
lufia Apr 8, 2019
5d68f02
plan9: add mkfile to install headers
lufia Apr 8, 2019
cd510f6
plan9: add mkfiles to install openssl
lufia Apr 8, 2019
f3abfe1
plan9: apply patches
lufia Apr 8, 2019
cb675fc
plan9: add a mkfile to compile, build and install artifacts
lufia Apr 8, 2019
9df4ce8
Merge branch 'master' into plan9
lufia Apr 29, 2019
3160fe9
plan9: add targets to compile sm4
lufia Apr 29, 2019
a1e979f
plan9: update patches
lufia Apr 29, 2019
b82a835
plan9: add files to generate mkfiles on Plan 9
lufia May 19, 2019
f1017e7
plan9: add a document
lufia May 31, 2019
bd38f60
plan9: refactor building scripts
lufia May 31, 2019
0e72b5c
plan9: clear auto-generatable mkfiles
lufia May 31, 2019
c25731f
plan9: use awk version header file generator for objects
lufia Jun 20, 2019
430891f
Merge branch 'master' into plan9
lufia Jul 31, 2019
326cd12
Merge remote-tracking branch 'upstream/master' into plan9
lufia Jan 3, 2020
60f6ec1
plan9: update patches
lufia Jan 3, 2020
a03dde4
plan9: add plan9 specific files to dist
lufia Feb 5, 2020
f556d52
plan9: change install steps
lufia Feb 5, 2020
6eafcd3
Merge remote-tracking branch 'upstream/master' into plan9
lufia Feb 6, 2020
24ffe9b
Merge remote-tracking branch 'upstream/master' into plan9
lufia May 31, 2020
10b7473
update patches
lufia May 31, 2020
373fe5e
update patches
lufia May 29, 2021
d8a4192
Merge remote-tracking branch 'upstream/master' into plan9
lufia May 29, 2021
e2b9b2e
plan9: simplify patches
lufia May 30, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ endif
EXTRA_DIST = README.md README.windows VERSION config scripts
EXTRA_DIST += CMakeLists.txt cmake_export_symbol.cmake cmake_uninstall.cmake.in FindLibreSSL.cmake
EXTRA_DIST += cert.pem openssl.cnf x509v3.cnf
EXTRA_DIST += README.plan9 plan9 gen-mkfile.sh mkfile

.PHONY: install_sw
install_sw: install
Expand Down
43 changes: 43 additions & 0 deletions README.plan9
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Building LibreSSL #

**This is very early version.**

## Prerequisites when building from a Git checkout ##

1. Ensure you have the following packages installed: git
2. Run `./autogen.rc` to prepare the source tree for building.

## Steps that apply to all builds ##

Before building LibreSSL, You must install latest 9legacy stable patches, and
four pull-requests for 0intro/plan9-contrib and lufia/plan9.

* https://github.com/0intro/plan9-contrib/pull/6
* https://github.com/0intro/plan9-contrib/pull/7
* https://github.com/0intro/plan9-contrib/pull/13
* https://github.com/lufia/plan9/pull/10

Once you have a source tree, either by downloaded using git and having
run the `autogen.sh` script above, or by downloading a release distribution from
an OpenBSD mirror, run these commands to build and install the package on most
systems:

```sh
mk
mk install
```

# Development

If you catch any problem, you can update patches in plan9 directory.
For example, to merge a changes for crypto/cpt_err.c into crypto.patch:

git clean -xf
IGNOREPLAN9PATCHES=1 ./autogen.rc
mkdir (crypto ssl tls apps)^.orig
for(i in crypto ssl tls apps)
dircp $i $i.orig

Feel free edit crypto/cpt_err.c, then update a patch:

ape/diff -uprN -X mkfile crypto.orig crypto >plan9/crypto.patch
30 changes: 30 additions & 0 deletions autogen.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/rc

flag e +
rfork ne

ape/psh ./update.sh

for(f in `{ls apps/*/*.c}){
sed 's/ \.opt\.([a-zA-Z0-9_]+) = (.*),$/ .opt = { .\1 = \2 },/' $f >/tmp/autogen.$pid
cp /tmp/autogen.$pid $f
}
for(f in `{grep -l '<openssl/(asn1|ocsp|pkcs12|x509v3)\.h>' */*.c */*/*.c}){
awk '
{ print }
n > 0 { next }
/^#include[ \t]+<openssl\/(asn1|ocsp|pkcs12|x509v3)\.h>$/ {
print "#include <openssl/asn1t.h>"
n++
}
' $f >/tmp/autogen.$pid
cp /tmp/autogen.$pid $f
}
rm /tmp/autogen.$pid

cp plan9/apps.mkfile apps/mkfile
ape/psh ./gen-mkfile.sh lib crypto/Makefile.am
ape/psh ./gen-mkfile.sh lib ssl/Makefile.am
ape/psh ./gen-mkfile.sh lib tls/Makefile.am
ape/psh ./gen-mkfile.sh bin apps/openssl/Makefile.am
ape/psh ./gen-mkfile.sh include include/Makefile.am
3 changes: 2 additions & 1 deletion crypto/compat/timegm.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ static long long __year_to_secs(long long year, int *is_leap)

int cycles, centuries, leaps, rem;

if (!is_leap) is_leap = &(int){0};
int _is_leap = 0;
if (!is_leap) is_leap = &_is_leap;
cycles = (year-100) / 400;
rem = (year-100) % 400;
if (rem < 0) {
Expand Down
Loading