My Linux build machine is Ubuntu 16.04 with gcc 5.4. I can still build the mainline jdk repo using that compiler. When I try to build the jpackager sandbox, I get the following link error:
ERROR: Build failed for target 'images' in configuration 'linux-x86_64-normal-server-release' (exit code 2)
=== Output from failing command(s) repeated here ===
* For target support_native_jdk.packager_libpackager_BUILD_LIBPACKAGER_link:
/localhome/kcr/java/sandbox/build/linux-x86_64-normal-server-release/support/native/jdk.packager/libpackager/PlatformThread.o: In function `PlatformThread::Wait()':
/localhome/kcr/java/sandbox/open/src/jdk.packager/share/native/library/common/PlatformThread.cpp:75: undefined reference to `pthread_join'
/localhome/kcr/java/sandbox/build/linux-x86_64-normal-server-release/support/native/jdk.packager/libpackager/PlatformThread.o: In function `PlatformThread::Terminate()':
/localhome/kcr/java/sandbox/open/src/jdk.packager/share/native/library/common/PlatformThread.cpp:66: undefined reference to `pthread_cancel'
/localhome/kcr/java/sandbox/build/linux-x86_64-normal-server-release/support/native/jdk.packager/libpackager/PlatformThread.o: In function `PlatformThread::Run()':
/localhome/kcr/java/sandbox/open/src/jdk.packager/share/native/library/common/PlatformThread.cpp:57: undefined reference to `pthread_create'
/localhome/kcr/java/sandbox/build/linux-x86_64-normal-server-release/support/native/jdk.packager/libpackager/PlatformThread.o: In function `PlatformThread::Terminate()':
/localhome/kcr/java/sandbox/open/src/jdk.packager/share/native/library/common/PlatformThread.cpp:66: undefined reference to `pthread_cancel'
/localhome/kcr/java/sandbox/build/linux-x86_64-normal-server-release/support/native/jdk.packager/libpackager/PlatformThread.o: In function `PlatformThread::Wait()':
/localhome/kcr/java/sandbox/open/src/jdk.packager/share/native/library/common/PlatformThread.cpp:75: undefined reference to `pthread_join'
/localhome/kcr/java/sandbox/build/linux-x86_64-normal-server-release/support/native/jdk.packager/libpackager/PosixPlatform.o: In function `PosixPlatform::LoadLibrary(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)':
/localhome/kcr/java/sandbox/open/src/jdk.packager/share/native/library/common/PosixPlatform.cpp:145: undefined reference to `dlopen'
... (rest of output omitted)
* For target support_native_jdk.packager_papplauncher_BUILD_PACKAGERAPPLAUNCHEREXE_link:
/localhome/kcr/java/sandbox/build/linux-x86_64-normal-server-release/support/native/jdk.packager/papplauncher/launcher.o: In function `main':
/localhome/kcr/java/sandbox/open/src/jdk.packager/linux/native/launcher/launcher.cpp:61: undefined reference to `dlopen'
/localhome/kcr/java/sandbox/open/src/jdk.packager/linux/native/launcher/launcher.cpp:70: undefined reference to `dlsym'
/localhome/kcr/java/sandbox/open/src/jdk.packager/linux/native/launcher/launcher.cpp:71: undefined reference to `dlsym'
/localhome/kcr/java/sandbox/open/src/jdk.packager/linux/native/launcher/launcher.cpp:81: undefined reference to `dlclose'
/localhome/kcr/java/sandbox/open/src/jdk.packager/linux/native/launcher/launcher.cpp:64: undefined reference to `dlerror'
collect2: error: ld returned 1 exit status
* All command lines available in /localhome/kcr/java/sandbox/build/linux-x86_64-normal-server-release/make-support/failure-logs.
=== End of repeated output ===
=== Make failed targets repeated here ===
Lib-jdk.packager.gmk:71: recipe for target '/localhome/kcr/java/sandbox/build/linux-x86_64-normal-server-release/support/native/jdk.packager/papplauncher/papplauncher' failed
Lib-jdk.packager.gmk:44: recipe for target '/localhome/kcr/java/sandbox/build/linux-x86_64-normal-server-release/support/native/jdk.packager/libpackager/libpackager.so' failed
make/Main.gmk:215: recipe for target 'jdk.packager-libs' failed
=== End of repeated output ===
Hint: Try searching the build log for the name of the first failed target.
Hint: See doc/building.html#troubleshooting for assistance.
/localhome/kcr/java/sandbox/open/make/Init.gmk:300: recipe for target 'main' failed
make[1]: *** [main] Error 1
/localhome/kcr/java/sandbox/open/make/Init.gmk:186: recipe for target 'images' failed
make: *** [images] Error 2
ERROR: Build failed for target 'images' in configuration 'linux-x86_64-normal-server-release' (exit code 2)
=== Output from failing command(s) repeated here ===
* For target support_native_jdk.packager_libpackager_BUILD_LIBPACKAGER_link:
/localhome/kcr/java/sandbox/build/linux-x86_64-normal-server-release/support/native/jdk.packager/libpackager/PlatformThread.o: In function `PlatformThread::Wait()':
/localhome/kcr/java/sandbox/open/src/jdk.packager/share/native/library/common/PlatformThread.cpp:75: undefined reference to `pthread_join'
/localhome/kcr/java/sandbox/build/linux-x86_64-normal-server-release/support/native/jdk.packager/libpackager/PlatformThread.o: In function `PlatformThread::Terminate()':
/localhome/kcr/java/sandbox/open/src/jdk.packager/share/native/library/common/PlatformThread.cpp:66: undefined reference to `pthread_cancel'
/localhome/kcr/java/sandbox/build/linux-x86_64-normal-server-release/support/native/jdk.packager/libpackager/PlatformThread.o: In function `PlatformThread::Run()':
/localhome/kcr/java/sandbox/open/src/jdk.packager/share/native/library/common/PlatformThread.cpp:57: undefined reference to `pthread_create'
/localhome/kcr/java/sandbox/build/linux-x86_64-normal-server-release/support/native/jdk.packager/libpackager/PlatformThread.o: In function `PlatformThread::Terminate()':
/localhome/kcr/java/sandbox/open/src/jdk.packager/share/native/library/common/PlatformThread.cpp:66: undefined reference to `pthread_cancel'
/localhome/kcr/java/sandbox/build/linux-x86_64-normal-server-release/support/native/jdk.packager/libpackager/PlatformThread.o: In function `PlatformThread::Wait()':
/localhome/kcr/java/sandbox/open/src/jdk.packager/share/native/library/common/PlatformThread.cpp:75: undefined reference to `pthread_join'
/localhome/kcr/java/sandbox/build/linux-x86_64-normal-server-release/support/native/jdk.packager/libpackager/PosixPlatform.o: In function `PosixPlatform::LoadLibrary(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)':
/localhome/kcr/java/sandbox/open/src/jdk.packager/share/native/library/common/PosixPlatform.cpp:145: undefined reference to `dlopen'
... (rest of output omitted)
* For target support_native_jdk.packager_papplauncher_BUILD_PACKAGERAPPLAUNCHEREXE_link:
/localhome/kcr/java/sandbox/build/linux-x86_64-normal-server-release/support/native/jdk.packager/papplauncher/launcher.o: In function `main':
/localhome/kcr/java/sandbox/open/src/jdk.packager/linux/native/launcher/launcher.cpp:61: undefined reference to `dlopen'
/localhome/kcr/java/sandbox/open/src/jdk.packager/linux/native/launcher/launcher.cpp:70: undefined reference to `dlsym'
/localhome/kcr/java/sandbox/open/src/jdk.packager/linux/native/launcher/launcher.cpp:71: undefined reference to `dlsym'
/localhome/kcr/java/sandbox/open/src/jdk.packager/linux/native/launcher/launcher.cpp:81: undefined reference to `dlclose'
/localhome/kcr/java/sandbox/open/src/jdk.packager/linux/native/launcher/launcher.cpp:64: undefined reference to `dlerror'
collect2: error: ld returned 1 exit status
* All command lines available in /localhome/kcr/java/sandbox/build/linux-x86_64-normal-server-release/make-support/failure-logs.
=== End of repeated output ===
=== Make failed targets repeated here ===
Lib-jdk.packager.gmk:71: recipe for target '/localhome/kcr/java/sandbox/build/linux-x86_64-normal-server-release/support/native/jdk.packager/papplauncher/papplauncher' failed
Lib-jdk.packager.gmk:44: recipe for target '/localhome/kcr/java/sandbox/build/linux-x86_64-normal-server-release/support/native/jdk.packager/libpackager/libpackager.so' failed
make/Main.gmk:215: recipe for target 'jdk.packager-libs' failed
=== End of repeated output ===
Hint: Try searching the build log for the name of the first failed target.
Hint: See doc/building.html#troubleshooting for assistance.
/localhome/kcr/java/sandbox/open/make/Init.gmk:300: recipe for target 'main' failed
make[1]: *** [main] Error 1
/localhome/kcr/java/sandbox/open/make/Init.gmk:186: recipe for target 'images' failed
make: *** [images] Error 2