KnoooW / naclports

Automatically exported from code.google.com/p/naclports
0 stars 0 forks source link

opencv in r1054 fails to compile under newlib #106

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The complete output of running  ``NACL_ARCH=pnacl make opencv`` is attached. 
The compilation error is

[…]/out/repository/opencv-2.4.7/modules/highgui/src/cap_gstreamer.cpp:340:15: 
error: use of undeclared identifier 'realpath'
        uri = realpath(filename, NULL);

What helps is declaring the realpath function directly in the offending file. 
The patch is at https://codereview.chromium.org/136333006

And again, it fails on my computer yet it seems to build fine on the bots. I 
have no explanation for this.

Original issue reported on code.google.com by jirkadan...@gmail.com on 17 Jan 2014 at 4:56

Attachments:

GoogleCodeExporter commented 9 years ago
I filled a bug in native_client at 
https://code.google.com/p/nativeclient/issues/detail?id=3773

It seems that the realpath function is neither declared nor implemented for 
pnacl. Adding the declaration therefore only postpones the problem until 
someone attempts to use some function in the libopencv_highgui.a (that is the 
only OpenCV .a archive that holds reference to the realpath symbol).

I think not being to able to link some programs that use OpenCV is better than 
not being able to build the OpenCV library at all, therefore I plan to continue 
to use my fix myself. But I am no longer sure that it should be committed to 
nacl_ports. 

Original comment by 374...@mail.muni.cz on 17 Jan 2014 at 10:35

GoogleCodeExporter commented 9 years ago
I think that until we get realpath defined in the toolchain you can probably
just define realpath in the source tree in terms of strcpy.  Since there are no
symlinks (yet!) in nacl_io realpath is less meanfull and normal anyway when 
running
under nacl_io.

Original comment by sbc@chromium.org on 17 Jan 2014 at 10:48

GoogleCodeExporter commented 9 years ago
realpath does seem to be in the PNaCl headers at this point, and a stub 
implemenation of realpath is in the C library.

Please re-open if this problem persists.

Original comment by sbc@google.com on 30 Sep 2014 at 6:45

GoogleCodeExporter commented 9 years ago
Correction, realpath is declared in the PNaCl headers but you need to link 
against nacl_io to get an implementation.

Original comment by sbc@google.com on 30 Sep 2014 at 6:47