Intel® C++ Compiler
Support and discussions for creating C++ code that runs on platforms based on Intel® processors.
7700 Discussions

Moving from icc to icx: known but unsupported action 'nopage' for '#pragma section' -

roberto_g_2
New Contributor I
762 Views

Dear Staff,

 

is there any chance that "nopage" in #pragma section will be supported in the future releases?

 

Thank you

-Roberto

0 Kudos
10 Replies
HemanthCH_Intel
Moderator
726 Views

Hi Roberto ,

Thanks for reaching out to us.

We are looking into your query and get back to you soon.


Thanks & Regards,

Hemanth Chintala.


Viet_H_Intel
Moderator
706 Views

Hi Roberto,


Seems like icx supports nopage on Linux. Are you asking for Windows?

$ icpx test.cpp -fdeclspec

$ cat test.cpp

#pragma section(".data",nopage)

__declspec(allocate(".data"))



int main(){

  return 0;

}


C:\temp>icx test.cpp

Intel(R) oneAPI DPC++/C++ Compiler for applications running on Intel(R) 64, Version 2021.4.0 Build 20210924

Copyright (C) 1985-2021 Intel Corporation. All rights reserved.


test.cpp(1,9): warning: known but unsupported action 'nopage' for '#pragma section' - ignored [-Wignored-pragmas]

#pragma section(".data",nopage)

    ^

1 warning generated.


C:\temp>


roberto_g_2
New Contributor I
698 Views

Thank you for handling my question. Sure, sorry, I forgot to say that it was for Windows

A workaround is to compile the objects, and use link.exe instead of lld-link.exe, and give the option /SECTION:name,!P but this prevents from using lld-link. 

Regards

-Roberto

Viet_H_Intel
Moderator
694 Views

Can you give us an example testcase, compile and link steps for your workaround that prevents you from using lld-link?

Thanks,


roberto_g_2
New Contributor I
685 Views

Sure!

-R

 

C:\temp>type foo.cpp

#include <iostream>

using namespace std;

#pragma section(".mysection")
__declspec(allocate(".mysection")) int x = 1;


int main(){
cout << x << endl;
return 0;
}

 

C:\temp> icx.exe /c /Qm64 foo.cpp 

C:\temp> link.exe /SECTION:.mysection,R!P foo.obj

C:\temp> foo.exe

1

 

C:\temp> lld-link.exe /SECTION:.mysection,R!P foo.obj
lld-link: error: /section: invalid argument: R!P

 

Viet_H_Intel
Moderator
665 Views

Hi Roberto,


Thank for the test case. I've submitted a request to the compiler team. I'll keep you posted.


roberto_g_2
New Contributor I
655 Views
HemanthCH_Intel
Moderator
253 Views

Hi,

 

Thank you for your feedback. We have provided your feedback to the relevant team. At this moment there is no visibility when it will be implemented and available for use. Please let me know if we can go ahead and close this case.

 

Thanks & Regards,

Hemanth

 

HemanthCH_Intel
Moderator
217 Views

Hi,


We are closing this thread. If you need any additional information, please post a new question as this thread will no longer be monitored by Intel.


Thanks & Regards,

Hemanth


roberto_g_2
New Contributor I
208 Views

Yes please, thanks for answering!

-R

Reply