-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
release 2.55: Revert PR 8829 (#8896)
Revert PR #8829 for release/2.55 because Silkworm is not compatible with some Linux flavours yet.
- Loading branch information
Showing
19 changed files
with
763 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
//go:build unix | ||
|
||
package silkworm | ||
|
||
/* | ||
#cgo LDFLAGS: -ldl | ||
#include <dlfcn.h> | ||
#include <stdlib.h> | ||
*/ | ||
import "C" | ||
|
||
import ( | ||
"fmt" | ||
"unsafe" | ||
) | ||
|
||
func OpenLibrary(dllPath string) (unsafe.Pointer, error) { | ||
cPath := C.CString(dllPath) | ||
defer C.free(unsafe.Pointer(cPath)) | ||
dllHandle := C.dlopen(cPath, C.RTLD_LAZY) | ||
if dllHandle == nil { | ||
err := C.GoString(C.dlerror()) | ||
return nil, fmt.Errorf("failed to load dynamic library %s: %s", dllPath, err) | ||
} | ||
return dllHandle, nil | ||
} | ||
|
||
func LoadFunction(dllHandle unsafe.Pointer, funcName string) (unsafe.Pointer, error) { | ||
cName := C.CString(funcName) | ||
defer C.free(unsafe.Pointer(cName)) | ||
funcPtr := C.dlsym(dllHandle, cName) | ||
if funcPtr == nil { | ||
err := C.GoString(C.dlerror()) | ||
return nil, fmt.Errorf("failed to find the %s function: %s", funcName, err) | ||
} | ||
return funcPtr, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
//go:build windows | ||
|
||
package silkworm | ||
|
||
import ( | ||
"errors" | ||
"unsafe" | ||
) | ||
|
||
func OpenLibrary(dllPath string) (unsafe.Pointer, error) { | ||
return nil, errors.New("not implemented") | ||
} | ||
|
||
func LoadFunction(dllHandle unsafe.Pointer, funcName string) (unsafe.Pointer, error) { | ||
return nil, errors.New("not implemented") | ||
} |
Oops, something went wrong.