Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save navyxliu/bacd47891b17ac8d33d04708b648b531 to your computer and use it in GitHub Desktop.
Save navyxliu/bacd47891b17ac8d33d04708b648b531 to your computer and use it in GitHub Desktop.
SetupNativeCompilation(BUILD_TEST_ProcessUtils)
[2] LIBRARY := ProcessUtils
[3] EXTRA_FILES := /src/hotspot/test/vmTestbase/vm/share/libProcessUtils.cpp
[4] OUTPUT_DIR := /build/support/test/hotspot/jtreg/native/lib
[5] OBJECT_DIR := /build/support/test/hotspot/jtreg/native/support/libProcessUtils
[6] LANG := C++
[7] CFLAGS := -Wall -Wno-parentheses -Wextra -Wno-unused -Wno-unused-parameter -Wformat=2 -pipe -fstack-protector -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE -fno-omit-frame-pointer -D_LP64=1 -D_LITTLE_ENDIAN -DLINUX -DARCH='"amd64"' -Damd64 -DDEBUG -DRELEASE='"1.8.0-internal-fastdebug"' -I/build/jdk/include -I/build/jdk/include/linux -I/src/jdk/src/share/javavm/export -I/src/jdk/src/solaris/javavm/export -I/src/jdk/src/share/native/common -I/src/jdk/src/solaris/native/common -fno-strict-aliasing -g1 -fPIC -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -I/src/hotspot/test/vmTestbase/vm/share -I/src/hotspot/test/vmTestbase/nsk/share/native -I/src/hotspot/test/vmTestbase/nsk/share/jni
[8] CXXFLAGS := -Wall -Wno-parentheses -Wextra -Wno-unused -Wno-unused-parameter -Wformat=2 -pipe -fstack-protector -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE -fno-omit-frame-pointer -D_LP64=1 -D_LITTLE_ENDIAN -DLINUX -DARCH='"amd64"' -Damd64 -DDEBUG -DRELEASE='"1.8.0-internal-fastdebug"' -I/build/jdk/include -I/build/jdk/include/linux -I/src/jdk/src/share/javavm/export -I/src/jdk/src/solaris/javavm/export -I/src/jdk/src/share/native/common -I/src/jdk/src/solaris/native/common -std=gnu++98 -g1 -fPIC -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -I/src/hotspot/test/vmTestbase/vm/share -I/src/hotspot/test/vmTestbase/nsk/share/native -I/src/hotspot/test/vmTestbase/nsk/share/jni
[9] LDFLAGS := -Wl,-z,relro -Xlinker --hash-style=both -Xlinker -z -Xlinker defs -Xlinker -z -Xlinker noexecstack -shared -L/build/jdk/lib/amd64 -L/build/jdk/lib/amd64/server -Xlinker -z -Xlinker origin -Xlinker -rpath -Xlinker \$ORIGIN
[10] DISABLED_WARNINGS_gcc := format undef unused-function unused-value
[11] DISABLED_WARNINGS_clang := undef format-nonliteral missing-field-initializers sometimes-uninitialized
[12] DISABLED_WARNINGS_CXX_solstudio := wvarhidenmem
[13] TOOLCHAIN := TOOLCHAIN_LINK_CXX
[14] OPTIMIZATION := LOW
[15] COPY_DEBUG_SYMBOLS := false
[16] STRIP_SYMBOLS := false
SetupCopyFiles(COPY_HOTSPOT_JTREG_NATIVE)
[2] SRC := /build/support/test/hotspot/jtreg/native
[3] DEST := /hotspot/jtreg/native
[4] FILES :=
[5] FLATTEN := true
gmake[1]: Entering directory `/src/hotspot/test'
echo "Linking libdefine.so"
Linking libdefine.so
/usr/bin/gcc -Wl,-z,relro -Xlinker --hash-style=both -Xlinker -z -Xlinker defs -Xlinker -z -Xlinker noexecstack -shared -L/build/jdk/lib/amd64 -L/build/jdk/lib/amd64/server -Xlinker -z -Xlinker origin -Xlinker -rpath -Xlinker \RIGIN -Xlinker -soname=libdefine.so -o /build/support/test/hotspot/jtreg/native/lib/libdefine.so /build/support/test/hotspot/jtreg/native/support/libdefine/libdefine.o
/build/support/test/hotspot/jtreg/native/support/libdefine/libdefine.o:(.data.DW.ref.__gxx_personality_v0[DW.ref.__gxx_personality_v0]+0x0): undefined reference to `__gxx_personality_v0'
collect2: ld returned 1 exit status
gmake[1]: *** [/build/support/test/hotspot/jtreg/native/lib/libdefine.so] Error 1
@navyxliu
Copy link
Author

add this to TestFilesCompilation.gmk
LDFLAGS_SUFFIX := $$(LIBCXX), \

it will add "LIBCXX:= -Wl,-Bstatic -lstdc++ -lgcc -Wl,-Bdynamic" to the linker.
works for gcc 4.6 on x86_64.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment