aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew G. Morgan <morgan@kernel.org>2023-02-11 21:15:03 -0800
committerAndrew G. Morgan <morgan@kernel.org>2023-02-11 21:15:03 -0800
commit5c6c1fbebc12a08868c7590e51a736e814b6d2b7 (patch)
treebfc9a7e402369818937e8d4b5ab07ff75c4b307d
parent7e41da10505189b8dbee93b25dea1dfb07a89d9b (diff)
downloadlibcap-5c6c1fbebc12a08868c7590e51a736e814b6d2b7.tar.gz
Drop vendor directory and clean up extra gcc...sh file
These three files were left over, they should have been removed in the last commit. Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
-rwxr-xr-xcontrib/bug216610/gcc_linux_amd64.sh58
-rw-r--r--contrib/bug216610/go/vendor/fibber/fib.go26
-rw-r--r--contrib/bug216610/go/vendor/fibber/fibs_linux_amd64.s57
3 files changed, 0 insertions, 141 deletions
diff --git a/contrib/bug216610/gcc_linux_amd64.sh b/contrib/bug216610/gcc_linux_amd64.sh
deleted file mode 100755
index a228c53..0000000
--- a/contrib/bug216610/gcc_linux_amd64.sh
+++ /dev/null
@@ -1,58 +0,0 @@
-#!/bin/bash
-#
-# The Go linker does not seem to know what to do with relative
-# addressing of rodata.* offset from %rip. GCC likes to use this
-# addressing mode on this architecture, so we quickly run into
-# mis-computation when the relative addressing used in a .syso file of
-# symbol located data is resolved to completely the wrong place by the
-# Go (internal) linker.
-#
-# As a workaround for this, we can modify the assembly source code
-# generated by GCC to not point at problematic '.rodata.*' sections,
-# and place this data in the good old '.text' section where Go's
-# linker can make sense of it.
-#
-# This script exists to generate a '.syso' file from some '*.c' files.
-# It works by recognizing the '*.c' command line arguments and
-# converting them into fixed-up '*.s' files. It then performs the
-# compilation for the collection of the '*.s' files. Upon success, it
-# purges the intermediate '*.s' files.
-#
-# The fragile aspect of this present script is which compiler
-# arguments should be used for the compilation from '.c' -> '.s'
-# files. What we do is accumulate arguments until we encounter our
-# first '*.c' file and use those to perform the '.c' -> '.o'
-# compilation. We build up a complete command line for gcc
-# substituting '.s' files for '.c' files in the original command
-# line. Then with the new command line assembled we invoke gcc with
-# those. If that works, we remove all of the intermediate '.s' files.
-setup=0
-args=()
-final=()
-ses=()
-for arg in "$@"; do
- if [[ "${arg##*.}" = "c" ]]; then
- setup=1
- s="${arg%.*}.s"
- "gcc" "${args[@]}" -S -o "${s}" "${arg}"
- sed -i -e 's/.*\.rodata\..*/\t.text/' "${s}"
- final+=("${s}")
- ses+=("${s}")
- else
- if [[ $setup -eq 0 ]]; then
- args+=("${arg}")
- fi
- final+=("${arg}")
- fi
-done
-
-#echo final: "${final[@]}"
-#echo args: "${args[@]}"
-#echo ses: "${ses[@]}"
-
-"gcc" "${final[@]}"
-if [[ $? -ne 0 ]]; then
- echo "failed to compile"
- exit 1
-fi
-rm -f "${ses[@]}"
diff --git a/contrib/bug216610/go/vendor/fibber/fib.go b/contrib/bug216610/go/vendor/fibber/fib.go
deleted file mode 100644
index e69a309..0000000
--- a/contrib/bug216610/go/vendor/fibber/fib.go
+++ /dev/null
@@ -1,26 +0,0 @@
-package fibber
-
-import (
- "unsafe"
-)
-
-type State struct {
- B, A uint32
-}
-
-func fibInit(ptr unsafe.Pointer)
-func fibNext(ptr unsafe.Pointer)
-
-// NewState initializes a Fibonacci Number sequence generator. Upon
-// return s.A=0 and s.B=1 are the first two numbers in the sequence.
-func NewState() (*State) {
- s := &State{}
- fibInit(unsafe.Pointer(&s.B))
- return s
-}
-
-// Next advances the state to the next number in the sequence. Upon
-// return, s.B is the most recently calculated value.
-func (s *State) Next() {
- fibNext(unsafe.Pointer(&s.B))
-}
diff --git a/contrib/bug216610/go/vendor/fibber/fibs_linux_amd64.s b/contrib/bug216610/go/vendor/fibber/fibs_linux_amd64.s
deleted file mode 100644
index 4e0d800..0000000
--- a/contrib/bug216610/go/vendor/fibber/fibs_linux_amd64.s
+++ /dev/null
@@ -1,57 +0,0 @@
-// To transition from a Go call to a C function call, we are skating
-// on really thin ice... Ceveat Emptor!
-//
-// Ref:
-// https://gitlab.com/x86-psABIs/x86-64-ABI/-/wikis/home
-//
-// This is not strictly needed, but it makes gdb debugging less
-// confusing because spacer ends up being an alias for the TEXT
-// section start.
-TEXT ·spacer(SB),$0
- RET
-
-#define RINDEX(n) (8*n)
-
-// Push all of the registers the C callee isn't expected to preserve.
-#define PUSHALL() \
- ADJSP $(RINDEX(9)) \
- MOVQ AX, RINDEX(0)(SP) \
- MOVQ CX, RINDEX(1)(SP) \
- MOVQ DX, RINDEX(2)(SP) \
- MOVQ SI, RINDEX(3)(SP) \
- MOVQ DI, RINDEX(4)(SP) \
- MOVQ R8, RINDEX(5)(SP) \
- MOVQ R9, RINDEX(6)(SP) \
- MOVQ R10, RINDEX(7)(SP) \
- MOVQ R11, RINDEX(8)(SP)
-
-// Pop all of the registers the C callee isn't expected to preserve.
-#define POPALL() \
- MOVQ RINDEX(0)(SP), AX \
- MOVQ RINDEX(1)(SP), CX \
- MOVQ RINDEX(2)(SP), DX \
- MOVQ RINDEX(3)(SP), SI \
- MOVQ RINDEX(4)(SP), DI \
- MOVQ RINDEX(5)(SP), R8 \
- MOVQ RINDEX(6)(SP), R9 \
- MOVQ RINDEX(7)(SP), R10 \
- MOVQ RINDEX(8)(SP), R11 \
- ADJSP $-(RINDEX(9))
-
-// Header to this function wrapper is the last time we can voluntarily
-// yield to some other goroutine.
-TEXT ·fibInit(SB),$0-8
- PUSHALL()
- MOVQ ptr+RINDEX(0)(FP), DI
- CALL fib_init(SB)
- POPALL()
- RET
-
-// Header to this function wrapper is the last time we can voluntarily
-// yield to some other goroutine.
-TEXT ·fibNext(SB),$0-8
- PUSHALL()
- MOVQ ptr+RINDEX(0)(FP), DI
- CALL fib_next(SB)
- POPALL()
- RET