From d9aad304cc8c78ad67c58f12070d47380a533aa5 Mon Sep 17 00:00:00 2001 From: Cedric Staub Date: Sat, 17 Feb 2018 12:00:55 -0800 Subject: [PATCH] Add CROSS-COMPILE.md, rm CLA link --- CONTRIBUTING.md | 19 +++++++------------ CROSS-COMPILE.md | 24 ++++++++++++++++++++++++ README.md | 14 +++++++------- 3 files changed, 38 insertions(+), 19 deletions(-) create mode 100644 CROSS-COMPILE.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e2e0eb61542..b174cd5de2e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,18 +1,13 @@ -# Contributing +# Contributing guidelines If you would like to contribute code to ghostunnel you can do so through GitHub by forking the repository and sending a pull request. -When submitting code, please make every effort to follow existing conventions -and style in order to keep the code as readable as possible. Please also make -sure all tests pass by running `make test`, and format your code with `go fmt`. +When submitting code, please make efforts to follow existing conventions and +style in order to keep the code as readable as possible. Please also make sure +all tests pass by running `make test`, and format your code with `go fmt`. Note that ghostunnel relies heavily on integration tests written in Python that -run checks on a live instance. If you are adding new features or changing -existing behavior, please add/update the integration tests in the tests directory -accordingly. - -Before your code can be accepted into the project you must also sign the -[Individual Contributor License Agreement][1]. - - [1]: https://spreadsheets.google.com/spreadsheet/viewform?formkey=dDViT2xzUHAwRkI3X3k5Z0lQM091OGc6MQ&ndplr=1 +run checks on a live instance. If you are adding new features or changing +existing behavior, please add/update the integration tests in the tests +directory accordingly. diff --git a/CROSS-COMPILE.md b/CROSS-COMPILE.md new file mode 100644 index 00000000000..b70aa2bf8e7 --- /dev/null +++ b/CROSS-COMPILE.md @@ -0,0 +1,24 @@ +# Instructions for cross-compiling + +Ghostunnel has support for loading private keys from PKCS#11 modules, which +should work with any hardware security module that exposes a PKCS#11 interface. +A working CGO toolchain is required in order to compile with PKCS#11 support +enabled. + +One way to cross-compile ghostunnel is with [karalabe/xgo][xgo]. Note that +libtool is a required build dependency, and libltdl needs to be available at +runtime. You can build a static binary to avoid the libltdl runtime dependency +by passing appropriate ldflags to the compiler. + +For example, to build a static 64-bit Windows binary: + + xgo \ + -deps https://ftp.gnu.org/pub/gnu/libtool/libtool-2.4.6.tar.gz \ + -branch master \ + -targets 'windows/amd64' \ + -ldflags "-w -extldflags \"-static\" -extld x86_64-w64-mingw32-gcc" \ + github.com/square/ghostunnel + +For more info, see [xgo][xgo]'s README on GitHub. + +[xgo]: https://github.com/karalabe/xgo diff --git a/README.md b/README.md index 3e5a2f465cd..9cd98fcf37f 100644 --- a/README.md +++ b/README.md @@ -86,11 +86,10 @@ To run tests: # Open coverage information in browser go tool cover -html coverage-merged.out -For more information on how to contribute, please see the [CONTRIBUTING][contr] file. +For more information on how to contribute, please see the [CONTRIBUTING](CONTRIBUTING.md) file. [gvt]: https://github.com/FiloSottile/gvt [gcvm]: https://github.com/wadey/gocovmerge -[contr]: https://github.com/square/ghostunnel/blob/master/CONTRIBUTING.md Usage Examples ============== @@ -248,11 +247,12 @@ For information on profiling via pprof, see the ### HSM/PKCS#11 support -Ghostunnel has experimental support for loading private keys from PKCS#11 -modules, which should work with any hardware security module that exposes a -PKCS#11 interface. An easy way to test the PKCS#11 interface for development -purposes is with [SoftHSM][softhsm]. Note that CGO is required in order for -PKCS#11 support to work. +Ghostunnel has support for loading private keys from PKCS#11 modules, which +should work with any hardware security module that exposes a PKCS#11 interface. +An easy way to test the PKCS#11 interface for development purposes is with +[SoftHSM][softhsm]. Note that CGO is required in order for PKCS#11 support to +work (see [CROSS-COMPILE.md](CROSS-COMPILE.md) for instructions to +cross-compile with CGO enabled). [softhsm]: https://github.com/opendnssec/SoftHSMv2