github.com/notti/nocgo@v0.0.0-20190619201224-fc443047424c/internal/dlopen/dlopen_linux.go (about)

     1  // +build !cgo
     2  
     3  package dlopen
     4  
     5  // we have to use the 3 argument format here :( - 2 argument format is only allowed from inside cgo
     6  
     7  //go:cgo_import_dynamic libc_dlopen_x dlopen "libdl.so.2"
     8  //go:cgo_import_dynamic libc_dlclose_x dlclose "libdl.so.2"
     9  //go:cgo_import_dynamic libc_dlsym_x dlsym "libdl.so.2"
    10  //go:cgo_import_dynamic libc_dlerror_x dlerror "libdl.so.2"
    11  
    12  // on amd64 we don't need the following line - on 386 we do...
    13  // anyway - with those lines the output is better (but doesn't matter) - without it on amd64 we get multiple DT_NEEDED with "libc.so.6" etc
    14  
    15  //go:cgo_import_dynamic _ _ "libdl.so.2"