wolfSSL / wolfssl

The wolfSSL library is a small, fast, portable implementation of TLS/SSL for embedded devices to the cloud. wolfSSL supports up to TLS 1.3 and DTLS 1.3!
https://www.wolfssl.com
GNU General Public License v2.0
2.34k stars 831 forks source link

mplab IDE compilation failure #702

Closed vppillai closed 7 years ago

vppillai commented 7 years ago

compiling the wolfssl.X project under wolfssl-3.10.0\wolfssl-3.10.0\mplabx is giving the following error (and a warning) with MPLABX IDE version 3.50 and XC32 version 1.42. Only change done to src tree is to uncomment #define MICROCHIP_PIC32 in wolfssl-3.10.0\wolfssl\wolfcrypt\settings.h (line 47)

nbproject/Makefile-default.mk:597: recipe for target 'build/default/production/_ext/181168623/random.o' failed
../../wolfcrypt/src/random.c:1241:38: fatal error: peripheral/timer.h: No such file or directory
         #include <peripheral/timer.h>
                                      ^
compilation terminated.
make[2]: *** [build/default/production/_ext/181168623/random.o] Error 1
make[2]: *** Waiting for unfinished jobs....
../../wolfcrypt/src/misc.c:49:6: warning: #warning misc.c does not need to be compiled when using inline (NO_INLINE not defined) [-Wcpp]
     #warning misc.c does not need to be compiled when using inline (NO_INLINE not defined)
      ^
kaleb-himes commented 7 years ago

Hi vppillai,

I can confirm this in v1.42 of xc32 there is no default "peripheral" directory in the include path. It looks like the xc32 directory structure has changed since we created the example applications and added the code sections to our library. The compile time check on misc.c is also a newer change we have made to reduce footprint size

I have added both of these as a feature to be updated in our next round of cleanup before release 3.10.2 goes out.

To resolve this for now please see the steps detailed below that I took to build the project:

  1. I grabbed the default timer.h header file found here: /Applications/microchip/xc32/v1.42/examples/xc32_examples/dsp_intrinsics/source/timer.h

  2. I created a directory (path-to-my-project)/peripheral

  3. I copy/pasted that default timer.h to the created peripheral directory and updated the project include paths: Right click project -> properties -> XC32 (Global Options) -> Common include dirs and added (path-to-my-project) The project built with the default timer.h from the xc32 example project.

  4. In the project expand the directory "Source Files / wolfcrypt" right-click the file "misc.c" and select "Exclude file(s) from current configuration"

  5. Build the wolfSSL.X project

The next issue I ran into when building the wolfcrypt_test application was a failure to include plib.h. I checked however and this file was in the correct location already and was also in the include path. Online I found this question: http://www.microchip.com/forums/m671361.aspx

Following that advice I right clicked the project -> Properties -> Conf: [default], Highlighted the compiler XC32 v1.42 and clicked "Apply" then "OK" and it resolved the issue of plib.h not being found. The wolfcrypt_test application built fine after that.