Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.
7931 Discussions

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

roberto_g_2
New Contributor I
1,334 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
1,298 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.


0 Kudos
Viet_H_Intel
Moderator
1,278 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>


0 Kudos
roberto_g_2
New Contributor I
1,270 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

0 Kudos
Viet_H_Intel
Moderator
1,266 Views

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

Thanks,


0 Kudos
roberto_g_2
New Contributor I
1,257 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

 

0 Kudos
Viet_H_Intel
Moderator
1,237 Views

Hi Roberto,


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


0 Kudos
roberto_g_2
New Contributor I
1,227 Views
0 Kudos
HemanthCH_Intel
Moderator
825 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

 

0 Kudos
HemanthCH_Intel
Moderator
789 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


0 Kudos
roberto_g_2
New Contributor I
780 Views

Yes please, thanks for answering!

-R

0 Kudos
Reply