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

Fix getopt linking error #163

Merged
merged 1 commit into from
Dec 11, 2022
Merged

Conversation

passgat
Copy link
Contributor

@passgat passgat commented Dec 11, 2022

The buildroot project, to which the sscep application was added, has configurations that raise the following linking error: buildroot/output/host/lib/gcc/arc-buildroot-linux-uclibc/11.3.0/../../../../arc-buildroot-linux-uclibc/bin/ld: buildroot/output/host/bin/../arc-buildroot-linux-uclibc/sysroot/usr/lib/libc.a(getopt.os):(.data+0x8): multiple definition of optind'; src/getopt.o:(.data+0x0): first defined here buildroot/output/host/lib/gcc/arc-buildroot-linux-uclibc/11.3.0/../../../../arc-buildroot-linux-uclibc/bin/ld: buildroot/output/host/bin/../arc-buildroot-linux-uclibc/sysroot/usr/lib/libc.a(getopt.os): in function __GI_getopt': getopt.c:(.text+0x5a4): multiple definition of getopt'; src/getopt.o:getopt.c:(.text+0x0): first defined here buildroot/output/host/lib/gcc/arc-buildroot-linux-uclibc/11.3.0/../../../../arc-buildroot-linux-uclibc/bin/ld: buildroot/output/host/bin/../arc-buildroot-linux-uclibc/sysroot/usr/lib/libc.a(getopt.os): in function getopt_long': getopt.c:(.text+0x5b0): multiple definition of `getopt_long'; src/getopt.o:getopt.c:(.text+0x128): first defined here collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:507: sscep] Error 1
make[1]: *** [package/pkg-generic.mk:293: buildroot/output/build/sscep-0.10.0/.stamp_built] Error 2

The patch re-added a check that commit
81f56f6 ("Replaced GNU getopt by a BSD licensed alternative") removed.

Signed-off-by: Dario Binacchi dario.binacchi@amarulasolutions.com

The buildroot project, to which the sscep application was added, has
configurations that raise the following linking error:
buildroot/output/host/lib/gcc/arc-buildroot-linux-uclibc/11.3.0/../../../../arc-buildroot-linux-uclibc/bin/ld: buildroot/output/host/bin/../arc-buildroot-linux-uclibc/sysroot/usr/lib/libc.a(getopt.os):(.data+0x8): multiple definition of `optind'; src/getopt.o:(.data+0x0): first defined here
buildroot/output/host/lib/gcc/arc-buildroot-linux-uclibc/11.3.0/../../../../arc-buildroot-linux-uclibc/bin/ld: buildroot/output/host/bin/../arc-buildroot-linux-uclibc/sysroot/usr/lib/libc.a(getopt.os): in function `__GI_getopt':
getopt.c:(.text+0x5a4): multiple definition of `getopt'; src/getopt.o:getopt.c:(.text+0x0): first defined here
buildroot/output/host/lib/gcc/arc-buildroot-linux-uclibc/11.3.0/../../../../arc-buildroot-linux-uclibc/bin/ld: buildroot/output/host/bin/../arc-buildroot-linux-uclibc/sysroot/usr/lib/libc.a(getopt.os): in function `getopt_long':
getopt.c:(.text+0x5b0): multiple definition of `getopt_long'; src/getopt.o:getopt.c:(.text+0x128): first defined here
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:507: sscep] Error 1
make[1]: *** [package/pkg-generic.mk:293: buildroot/output/build/sscep-0.10.0/.stamp_built] Error 2

The patch re-added a check that commit
81f56f6 ("Replaced GNU getopt by a BSD licensed alternative")
removed.

Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
@gotthardp gotthardp merged commit 65561b5 into certnanny:master Dec 11, 2022
@gotthardp
Copy link
Contributor

Sounds reasonable, thanks!

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

Successfully merging this pull request may close these issues.

2 participants