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

Compilation error on GCC 10 due to multiple definitions of __packed #32

Closed
frol opened this issue May 20, 2020 · 3 comments
Closed

Compilation error on GCC 10 due to multiple definitions of __packed #32

frol opened this issue May 20, 2020 · 3 comments

Comments

@frol
Copy link
Contributor

frol commented May 20, 2020

Starting from the upcoming GCC release 10, the default of -fcommon option will change to -fno-common - this leads to build errors:

[ 51%] Linking C static library libawdl.a
[ 51%] Built target awdl
Scanning dependencies of target owl
[ 54%] Building C object daemon/CMakeFiles/owl.dir/io.c.o
[ 56%] Building C object daemon/CMakeFiles/owl.dir/core.c.o
[ 59%] Building C object daemon/CMakeFiles/owl.dir/netutils.c.o
[ 62%] Building C object daemon/CMakeFiles/owl.dir/owl.c.o
[ 64%] Linking C executable owl
/usr/bin/ld: ../src/libawdl.a(rx.c.o):(.bss+0x0): multiple definition of `__packed'; ../src/libawdl.a(tx.c.o):(.bss+0x0): first defined here
/usr/bin/ld: ../libradiotap.a(radiotap.c.o):(.bss+0x0): multiple definition of `__packed'; ../src/libawdl.a(tx.c.o):(.bss+0x0): first defined here
collect2: error: ld returned 1 exit status

See also:
sahlberg/libiscsi#308
https://bugzilla.suse.com/show_bug.cgi?id=1160276
https://bugzilla.suse.com/show_bug.cgi?id=1160244

@3xitLight
Copy link

removing `__packed' from radiotap/radiotap.h fixed it.

patch:

From 771899b4f78ecfa9fe068015cad3f1783e766c92 Mon Sep 17 00:00:00 2001
From: 3XITLiGHT <x0c_ff@protonmail.com>
Date: Wed, 20 May 2020 07:39:25 +0200
Subject: [PATCH]  radiotap: remove `__packed` from struct
 ieee80211_radiotap_header declaration

Fix compilation error on GCC 10 due to multiple definitions of __packed

Signed-off-by: 3XITLiGHT <x0c_ff@protonmail.com>
---
 radiotap.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/radiotap.h b/radiotap.h
index 2055194..b9af740 100644
--- a/radiotap.h
+++ b/radiotap.h
@@ -50,7 +50,7 @@ struct ieee80211_radiotap_header {
 	 * @it_present: (first) present word
 	 */
 	uint32_t it_present;
-} __packed;
+};
 
 /* version is always 0 */
 #define PKTHDR_RADIOTAP_VERSION	0
-- 
2.26.2

@adamdicarlo
Copy link

This happened for me when installing from AUR, and this patch fixes it. Thanks! My system is on gcc 10.1.0.

@schmittner
Copy link
Member

This was a problem with radiotap-library as they use __packed instead of __attribute__((__packed__)). My pull request radiotap/radiotap-library#6 was just merged and solves this problem (#32) and #34.

bjzhang added a commit to bjzhang/xuxiake that referenced this issue Oct 27, 2022
```
-} __packed;
+} __attribute__((__packed__));
```

reference: seemoo-lab/owl#32 (comment)

Signed-off-by: Bamvor ZHANG <bamv2005@gmail.com>
bjzhang added a commit to bjzhang/xuxiake that referenced this issue Oct 30, 2022
1. Add system system register wrapper function;
2. Add mmu code for aarch64;
   2.1 Add mmu enable function;
   2.2 Add L0 and L1 page table to support 1G size page mapping;
   2.3 Set proper access permission;
3. Add CONFIG_USERSPACE and CONFIG_MMU for building. One could build
   with userspace or mmu supporting with the following line
   `make CFLAGS="-DCONFIG_USERSPACE"``
   `make CFLAGS="-DCONFIG_MMU"``
4. Note that previous commit make use of wrong method for pack. It
   should be ` __attribute__((__packed__))` instead of `__packed`.
   Reference the following link for more information
   seemoo-lab/owl#32 (comment)

Signed-off-by: Bamvor ZHANG <bamv2005@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants