Knowledge Library
Knowledge Library Home Knowledge Library Products Development Tools LLVM Compiler TCLLVM-66 : LLVM: Undefined reference to 'exp2'

TCLLVM-66 : LLVM: Undefined reference to 'exp2'

Defect #: TCLLVM-66
Found In VersionLLVM 3.8.0.0
Severity:Standard
Status:Acknowledged
Created Date:08/29/2017
Component/s :CLANG
Architecture:ARM

Description

The problem can be reproduced using VxWorks 7 SR500 release.

1) Create a VSB project based on xlnx_zynqmp_1_0_0_0 BSP.
2) Build the VSB project.
3) Create a VIP project based on the VSB project created in 1).
4) Include C++ support component in the VIP project.
5) Create a DKM project and insert the provided C++ test source into the DKM project.
6) Select "Non-Debug" build spec in the DKM project.
7) Make the DKM project as the sub project of the VIP project.
8) Build the VIP project. The following error is seen: 

F:/tmp/Test.cpp:(.text+0x1c): undefined reference to `exp2'

9) If the build spec of the DKM project is changed to "Debug" and the VIP is rebuilt, the build will complete without any errors. 

Test case:

$ cat Test.h
#ifndef TEST_H_
#define TEST_H_
#include <cstdlib>
   class Ppc
   {
   public:
      Ppc( unsigned int b);
   private:
      unsigned int extent;
   }; 
#endif
$ 
$ cat Test.cpp
#include "Test.h"
#include <cstdlib>
#include <iostream>
#include <math.h>
#include <algorithm>

Ppc::Ppc(unsigned int b)
 : extent(0)
{
		float x;
		float y;
		float z;

		x = 2.0;
		y = static_cast<float>(b);
		z = pow(x, y);
		extent = static_cast<unsigned int>(z);
}
$


Fix:
Add the option "-fno-builtin" to the DKM compilation step.

Steps to Reproduce

The problem can be reproduced using VxWorks 7 SR500 release.

1) Create a VSB project based on xlnx_zynqmp_1_0_0_0 BSP.
2) Build the VSB project.
3) Create a VIP project based on the VSB project created in 1).
4) Include C++ support component in the VIP project.
5) Create a DKM project and insert the attached C++ test source into the DKM project.
6) Select "Non-Debug" build spec in the DKM project.
7) Make the DKM project as the sub project of the VIP project.
8) Build the VIP project and the error should be triggered at the end of the build. 

9) If now change the build spec of DKM project to "Debug" and rebuild the VIP project, the build will be completed without error. 

KLID_DEFECT (use as Content ID for linking):  KLID_DEFECT_48354
 
You must to post a comment.
Last modified
01:43, 6 Sep 2017