Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add patch section for USB/IP #15

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,27 @@ Build USBIP tools:
/usr/src/4.19.43-microsoft-standard/tools/usb/usbip$ sudo make install -j 12
```

Copy link
Owner

Choose a reason for hiding this comment

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

Hi! Thanks for the commit. Q: Is this compiler message occurring because of an upgrade to GCC v8? Any ideas on why it did not occur before?

Copy link
Author

@studeo14 studeo14 Jun 15, 2020

Choose a reason for hiding this comment

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

Hi, thanks for replying! First of all, my kernel version is 4.19.104 on Ubuntu 20 with gcc 9.3.0. The USB/IP Makefiles seem to be settings the -Werror flag, so all of these small warnings will make the build fail. These errors are new features in gcc 9 so that could be why they haven't shown up before. I updated the README to reflect that as well.

For some kernel versions the following errors need to be patched:
1. `stringop-truncation`

Message:

In function ‘strncpy’,
inlined from ‘read_usb_vudc_device’ at usbip_device_driver.c:108:2:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:106:10: error: ‘__builtin_strncpy’ specified bound 256 equals destination size [-Werror=stringop-truncation]
106 | return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[Patch](https://patchwork.kernel.org/patch/10538575/)

2. `address-of-packed-member`

Message:

usbip_network.c:91:32: error: taking address of packed member of ‘struct usbip_usb_device’ may result in an unaligned pointer value [-Werror=address-of-packed-member]
91 | usbip_net_pack_uint32_t(pack, &udev->busnum);
| ^~~~~~~~~~~~~
[Patch](https://sources.debian.org/src/linux/5.4.19-1/debian/patches/bugfix/all/usbip-network-fix-unaligned-member-access.patch/)

Copy USBIP tools libraries to location that USBIP tools can get to them:
```
/usr/src/4.19.43-microsoft-standard/tools/usb/usbip$ sudo cp libsrc/.libs/libusbip.so.0 /lib/libusbip.so.0
Expand Down