Skip to content

Conversation

@thewon86
Copy link
Contributor

@thewon86 thewon86 commented Jun 9, 2023

Pull request

Choose Correct

  • bug
  • feature

Describe the pull request

Is ERPC support Windows platform? #299

To Reproduce

Expected behavior

Screenshots

Desktop (please complete the following information):

  • OS:
  • eRPC Version:

Steps you didn't forgot to do

  • I checked if other PR isn't solving this issue.
  • I read Contribution details and did appropriate actions.
  • PR code is tested.
  • PR code is formatted.
  • Allow edits from maintainers pull request option is set (recommended).

Additional context

@thewon86 thewon86 force-pushed the winsock2 branch 3 times, most recently from 9da190f to 9ef2a6b Compare June 9, 2023 02:44
@Hadatko Hadatko force-pushed the winsock2 branch 2 times, most recently from 5187cb9 to 79288f1 Compare June 21, 2023 13:52
@Hadatko Hadatko linked an issue Jun 21, 2023 that may be closed by this pull request
@Hadatko Hadatko added this to the 1.12.0 milestone Jun 21, 2023
@Hadatko Hadatko self-assigned this Jun 21, 2023
@Hadatko
Copy link
Member

Hadatko commented Jun 21, 2023

Hi @thewon86 , i was trying to add tests builds for mingw with your tcp layer. I had to do some changes also in source files due to errors. Can you confirm that these changes works for you?

@Hadatko
Copy link
Member

Hadatko commented Jun 21, 2023

@MichalPrincNXP Could you also review these changes? I added mingw tcp tests support so we see that server client may communicate.

Remove redundant print cmd
@Hadatko Hadatko linked an issue Jul 3, 2023 that may be closed by this pull request
2 tasks
Hadatko added 2 commits July 3, 2023 11:21
Signed-off-by: Cervenka Dusan <[email protected]>
Looks like server on mac target is not ready when client is executed

Signed-off-by: Cervenka Dusan <[email protected]>
@thewon86
Copy link
Contributor Author

thewon86 commented Jul 4, 2023

  1. #define ERPC_THREADS (ERPC_THREADS_PTHREADS)
  2. It looks mingw32 dose'nt support #pragma weak, there is a error in my project
build/obj/erpc_arbitrated_client_setup.o:erpc_arbitrated_client_setup.cpp:(.text+0x13b): undefined reference to `g_client'
build/obj/erpc_client_setup.o:erpc_client_setup.cpp:(.text+0xb1): undefined reference to `g_client'
build/obj/lvgl_is_designer_client.o:lvgl_is_designer_client.cpp:(.rdata$.refptr.g_client[.refptr.g_client]+0x0): undefined reference to `g_client'
I'd modified one of define in erpc_client_setup.cpp
#if defined(__MINGW32__)
ClientManager *g_client;
#else
ClientManager *g_client;
#pragma weak g_client
#endif

and it works well
3. .\mingw64\bin\mingw32-make.exe build=release erpc Done
4. .\mingw64\bin\mingw32-make.exe build=release erpcgen Done
5. .\mingw64\bin\mingw32-make.exe build=release test

G:/misc/rpc/erpc-develop/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: G:/misc/rpc/erpc-develop/test/test_const/MINGW64/tcp/gcc/test_const_client/Release/obj/
test/test_const/test_const_client_impl.o:test_const_client_impl.cpp:(.rdata$.refptr.accel[.refptr.accel]+0x0): undefined reference to `accel'
G:/misc/rpc/erpc-develop/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: G:/misc/rpc/erpc-develop/test/test_const/MINGW64/tcp/gcc/test_const_client/Release/obj/
test/test_const/test_const_client_impl.o:test_const_client_impl.cpp:(.rdata$.refptr.mass[.refptr.mass]+0x0): undefined reference to `mass'
G:/misc/rpc/erpc-develop/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: G:/misc/rpc/erpc-develop/test/test_const/MINGW64/tcp/gcc/test_const_client/Release/obj/
test/test_const/test_const_client_impl.o:test_const_client_impl.cpp:(.rdata$.refptr.y[.refptr.y]+0x0): undefined reference to `y'
G:/misc/rpc/erpc-develop/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: G:/misc/rpc/erpc-develop/test/test_const/MINGW64/tcp/gcc/test_const_client/Release/obj/
test/test_const/test_const_client_impl.o:test_const_client_impl.cpp:(.rdata$.refptr.x[.refptr.x]+0x0): undefined reference to `x'
G:/misc/rpc/erpc-develop/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: G:/misc/rpc/erpc-develop/test/test_const/MINGW64/tcp/gcc/test_const_client/Release/obj/
test/test_const/test_const_client_impl.o:test_const_client_impl.cpp:(.rdata$.refptr.d[.refptr.d]+0x0): undefined reference to `d'
G:/misc/rpc/erpc-develop/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: G:/misc/rpc/erpc-develop/test/test_const/MINGW64/tcp/gcc/test_const_client/Release/obj/
test/test_const/test_const_client_impl.o:test_const_client_impl.cpp:(.rdata$.refptr.c[.refptr.c]+0x0): undefined reference to `c'
G:/misc/rpc/erpc-develop/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: G:/misc/rpc/erpc-develop/test/test_const/MINGW64/tcp/gcc/test_const_client/Release/obj/
test/test_const/test_const_client_impl.o:test_const_client_impl.cpp:(.rdata$.refptr.b[.refptr.b]+0x0): undefined reference to `b'
G:/misc/rpc/erpc-develop/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: G:/misc/rpc/erpc-develop/test/test_const/MINGW64/tcp/gcc/test_const_client/Release/obj/
test/test_const/test_const_client_impl.o:test_const_client_impl.cpp:(.rdata$.refptr.a[.refptr.a]+0x0): undefined reference to `a'
collect2.exe: error: ld returned 1 exit status
mingw32-make[3]: *** [G:/misc/rpc/erpc-develop/mk/targets.mk:123: G:/misc/rpc/erpc-develop/test/test_const/MINGW64/tcp/gcc/test_const_client/Release/test_const_client_tcp_test] Error 1
mingw32-make[2]: *** [../mk/unit_test.mk:66: test_client_tcp] Error 2
mingw32-make[1]: *** [G:/misc/rpc/erpc-develop/mk/subdirs.mk:42: test_const] Error 2
mingw32-make: *** [G:/misc/rpc/erpc-develop/mk/subdirs.mk:42: test] Error 2

@Hadatko
Copy link
Member

Hadatko commented Jul 4, 2023

Hi @thewon86 could you try it with last commit? Also i don't understand why you posted errors with test_const. Build for mingw looks passing this test and you are mentioning only issue with g_client.

@thewon86
Copy link
Contributor Author

thewon86 commented Jul 5, 2023

Hi @thewon86 could you try it with last commit? Also i don't understand why you posted errors with test_const. Build for mingw looks passing this test and you are mentioning only issue with g_client.

The issue with g_client has been solved.
Sorry, maybe, i don't understand how the test works.

.\mingw64\bin\mingw32-make.exe build=debug all

G:/misc/rpc/erpc-develop/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: G:/
misc/rpc/erpc-develop/test/test_arrays/MINGW64/tcp/gcc/test_arrays_client/Debug/obj/test/test_arrays/MINGW64/tcp/gcc/tes
t_arrays_client/Debug/test_unit_test_common_client.o:test_unit_test_common_client.cpp:(.rdata+0x0): multiple definition
of `.weak.c_x._ZN4erpc5Codec9getStatusEv'; G:/misc/rpc/erpc-develop/test/test_arrays/MINGW64/tcp/gcc/test_arrays_client/
Debug/obj/test/test_arrays/MINGW64/tcp/gcc/test_arrays_client/Debug/test_client.o:test_client.cp:(.rdata+0x0): first def
ined here
collect2.exe: error: ld returned 1 exit status
mingw32-make[3]: *** [G:/misc/rpc/erpc-develop/mk/targets.mk:123: G:/misc/rpc/erpc-develop/test/test_arrays/MINGW64/tcp/
gcc/test_arrays_client/Debug/test_arrays_client_tcp_test] Error 1
mingw32-make[2]: *** [../mk/unit_test.mk:66: test_client_tcp] Error 2
mingw32-make[1]: *** [G:/misc/rpc/erpc-develop/mk/subdirs.mk:42: test_arrays] Error 2
mingw32-make: *** [G:/misc/rpc/erpc-develop/mk/subdirs.mk:42: test] Error 2

Is that because all c_x be defined with weak & extern?

// Constant variable definitions
#pragma weak c_x
extern const int32_t c_x = 5;

and .\mingw64\bin\mingw32-make.exe build=release all

G:/misc/rpc/erpc-develop/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: G:/
misc/rpc/erpc-develop/test/test_const/MINGW64/tcp/gcc/test_const_client/Release/obj/test/test_const/test_const_client_im
pl.o:test_const_client_impl.cpp:(.rdata$.refptr.accel[.refptr.accel]+0x0): undefined reference to `accel'
G:/misc/rpc/erpc-develop/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: G:/
misc/rpc/erpc-develop/test/test_const/MINGW64/tcp/gcc/test_const_client/Release/obj/test/test_const/test_const_client_im
pl.o:test_const_client_impl.cpp:(.rdata$.refptr.mass[.refptr.mass]+0x0): undefined reference to `mass'
.......

They all be declared weak & extern

@Hadatko
Copy link
Member

Hadatko commented Jul 11, 2023

Hi @thewon86 , unfortunatelly for mingw currently "make clean" doesn't work. Could you remove generated folders under each test and then press "make all" generate code again? You shouldn't see these errors then.

@thewon86
Copy link
Contributor Author

Hi @Hadatko , it works, everything done well.

@Hadatko
Copy link
Member

Hadatko commented Sep 18, 2023

@MichalPrincNXP any comments to this PR?

Copy link
Member

@MichalPrincNXP MichalPrincNXP left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks fine, thank you

@MichalPrincNXP MichalPrincNXP merged commit 78569ac into EmbeddedRPC:develop Sep 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

[BUG] It seems mingw support dosen't work Is ERPC support Windows platform?

3 participants