Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Alexey_S_Intel2
Employee
119 Views

identifier "MB_LEN_MAX" is undefined when -ffreestanding

Hi! 

Why the following program fails to compile with the option -ffreestanding? (Without -ffreestanding there is no errors.)

//test.cpp

#include <climits>

int main() {

char buf[MB_LEN_MAX];

return 0;

}

Command:  icpc test.cpp -ffreestanding -o test.exe

Output:

 error: identifier "MB_LEN_MAX" is undefined

 

0 Kudos
4 Replies
Viet_H_Intel
Moderator
119 Views

Seems like a compiler issue. I will report it to the compiler team.

Can you #include"/usr/include/limits.h" as a workaround?

Thanks,

Viet

Viet_H_Intel
Moderator
119 Views

I've reported this case CMPLRLIBS-2739

Alexey_S_Intel2
Employee
119 Views

Viet Hoang (Intel) wrote:

Can you #include"/usr/include/limits.h" as a workaround?

Hi, Viet!

No, I'm not sure that we can do it. But we may refrain from using the option -ffreestanding.

Our goal is to drop the dependency on libirc.so. The icpc optimizes some code and places the calls to __intel_fast_memcpy (as well as some other __intel_fast_-functions) in our library, which in turn bring us the unacceptable dependency on libirc.so.

So we just need to find a way to drop the dependency on the libirc.so (and we can not link in the static version of libirc library as well). Could you please provide us with any solution?

Viet_H_Intel
Moderator
119 Views

You can try  -fno-builtin to see if it helps; but to avoid dependency on Intel shared libs, you would need to link in statically (-static-intel)

Reply