Undefined Reference To IcmpSendEcho2Ex

64 views
Skip to first unread message

ad...@tec.hn

unread,
Jun 29, 2016, 10:10:29 AM6/29/16
to Avian
I'm trying to build Avian with OpenJDK 1.8.0 Update 91 Build 14, which I've built from source myself. I'm using a command:

make openjdk=$(pwd)/../jdk8u/build/windows-x86-normal-client-release/images/j2sdk-image openjdk-src=$(pwd)/../jdk8u/jdk/src arch=i386

And I get the following error:


I'm building the latest version of Avian on 32 bit Windows 10. I'm not too familiar with native development, but this seems to indicate that linker can't find iphlpapi library, right? I have IPHLPAPI.DLL in my System32 and SysWOW64 directories and IPHlpApi.Lib under C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Lib.


Joel Dice

unread,
Jun 30, 2016, 9:58:47 AM6/30/16
to Avian, ad...@tec.hn
Hi,

Avian is normally built with the MinGW-w64 toolchain instead of the Visual Studio toolchain (the VS toolchain can also work, but is not well supported and almost certainly won't work with the OpenJDK build).  That means the iphlpapi.lib on your system won't actually be used -- the MinGW equivalent libiphlpapi.a will be used instead.  Do you have that file on your system?  Under Cygwin, you can check whether it has the IcmpSendEcho2Ex symbol by running `nm libiphlapi.a | grep IcmpSendEcho2Ex`.  You might want to upgrade Cygwin first to make sure you have the latest MinGW-w64.

If that doesn't help, would you please post the steps you took to build OpenJDK 8?  I can try to reproduce the problem and debug it for you, but the build process for OpenJDK changes with each major release, and I haven't tried it myself since OpenJDK 7.

Martynas Petkevičius

unread,
Jun 30, 2016, 11:25:15 AM6/30/16
to Avian, ad...@tec.hn
 Running nm libiphlapi.a | grep IcmpSendEcho2Ex prints out nm: 'libiphlapi.a': No such file. However, if I use the full path to the lib nm /usr/lib/w32api/libiphlapi.a | grep IcmpSendEcho2Ex, I get the following:

Do I need to tell the build script where to look for the lib somehow?

Before building OpenJDK 8, I cloned http://hg.openjdk.java.net/jdk8u/jdk8u to a directory named jdk8u and changed to it. Then I ran the following commands:

./get_source.sh
./make/scripts/hgforest.sh update jdk8u91-b14
./configure --with-boot-jdk=$(pwd)/../openjdk-1.7.0-u80-unofficial-windows-i586-image --with-target-bits=32 --with-freetype=/cygdrive/c/Program\ Files\ \(x86\)/GnuWin32 --with-jvm-variants=client
make images

I also had to install some Cygwin packages and download FreeType as described here. Let me know if you'd like me to be more specific.

Joel Dice .

unread,
Jun 30, 2016, 11:37:04 AM6/30/16
to Avian, ad...@tec.hn
Are you using Cygwin?  The full path to the file should be /usr/i686-w64-mingw32/sys-root/mingw/lib/libiphlpapi.a (or /usr/x86_64-w64-mingw32/sys-root/mingw/lib/libiphlpapi.a for 64-bit builds).  If you don't have those files, you'll need to install the mingw64-i686-gcc-g++ and/or mingw64-x86_64-gcc-g++ packages.

--
You received this message because you are subscribed to the Google Groups "Avian" group.
To unsubscribe from this group and stop receiving emails from it, send an email to avian+un...@googlegroups.com.
To post to this group, send email to av...@googlegroups.com.
Visit this group at https://groups.google.com/group/avian.
For more options, visit https://groups.google.com/d/optout.

Joel Dice .

unread,
Jun 30, 2016, 11:38:38 AM6/30/16
to Avian, ad...@tec.hn
Nevermind, I see you are indeed using Cygwin.  But please do ensure you've installed the packages I mentioned.

ad...@tec.hn

unread,
Jun 30, 2016, 11:46:27 AM6/30/16
to Avian, ad...@tec.hn
Yes, I'm using Cygwin and I do have the packages you mentioned installed. libiphlpapi.a is under /usr/i686-w64-mingw32/sys-root/mingw/lib too. nm returns the same, but only when I use full path to libiphlpapi.a, otherwise it cannot find it.

Joel Dice .

unread,
Jun 30, 2016, 11:59:04 AM6/30/16
to Avian, ad...@tec.hn
Okay, I'll try building OpenJDK 8 myself and see if I can reproduce it
this evening when I have time. I'll let you know what happens.

Joel Dice .

unread,
Jun 30, 2016, 8:50:41 PM6/30/16
to Avian, Martynas Petkevičius
Where did you find Visual Studio 2010?  I can't find anything older than 2012.

On Thu, Jun 30, 2016 at 9:25 AM, Martynas Petkevičius <ad...@tec.hn> wrote:

--

ad...@tec.hn

unread,
Jul 1, 2016, 12:41:36 AM7/1/16
to Avian, ad...@tec.hn
I think I downloaded it from here.

Joel Dice .

unread,
Jul 1, 2016, 7:51:54 PM7/1/16
to Avian, Martynas Petkevičius
Hi Martynas,

This should fix it:

https://github.com/ReadyTalk/avian/pull/492

Let me know if you still have trouble. Thanks for reporting the issue
and helping me get OpenJDK built.

On Thu, Jun 30, 2016 at 10:41 PM, <ad...@tec.hn> wrote:
> I think I downloaded it from here.
>

ad...@tec.hn

unread,
Jul 2, 2016, 8:21:33 AM7/2/16
to Avian, ad...@tec.hn
Thanks, Avian built fine now! 
Reply all
Reply to author
Forward
0 new messages