7 Replies Latest reply on Nov 29, 2016 7:03 AM by Intel Corporation

    SDK compile errors: undefined reference to `__fputc_unlocked'

    Johan Kruger

      The IOT SDK distributed for the Galileo does not work. (Get compile errors when using fput/fget/fcntl)

       

      However, the SDK distributed for the Edison DOES work.

       

      The IOT SDKs can be found on the WEB over here: ( http: // iotdk.intel.com/sdk/3.5/ )

      galileo/

      edison/

       

      The compile errors I get with the Galileo SDK are similar to the following older thread over here: (which was answered, but not really resolved)

      Latest cross compile toolchain(glibc) for quark doesn't work

       

      I created the same test, to show the compile errors when 'fputc', 'fgetc' and others are called.

       

      test.c

      /*

      * Test program to show that the distributed SDK is broken

      * http://iotdk.intel.com/sdk/3.5/galileo/iot-devkit-toolchain-linux-64bit-galileo-20160606.sh

      *

      * Steps

      * 1: Source the environment

      *        source environment-setup-i586-poky-linux

      *

      * 2: Compile using the following command:

      *        $CC -o test test.c

      *

      * The following compile error will be shown:

      *

      *        /tmp/ccvcmLaV.o: In function `main':

      *        test.c:(.text+0x50): undefined reference to `__fputc_unlocked'

      *        collect2: error: ld returned 1 exit status

      */

       

      #include <stdio.h>

       

      int main()

          {

          fputc('a',stdout);

          printf("Used fputc to write the character 'a' to STDOUT\n");

          return 0;

          }

       

      Any workarounds I could apply to resolve these compiler errors with the Galileo SDK ?

       

      NOTES: I also tried sourcing the "environment-setup-x86-pokymllib32-linux-uclibc" instead, but that is even more broken, referencing compiler binaries that are not present in the SDK.

       

      My host is an "Ubuntu 14.04" 64-bit distribution.

       

      Please note, that this is for the Wind River Helix Application Cloud development project, and we do not want customers to have to re-create SDKs from scratch via source code, using bitbake or other tools.

      The distribution model provided at "http : // iotdk.intel.com/sdk/3.5/ "   (here is the  link 3.5/ ) are ideal for the creation of Helix Application Cloud SDKs, since all the work have been done already.

       

      .