Bug 21071 - can't able to create static link of dynamic object.
Summary: can't able to create static link of dynamic object.
Status: RESOLVED INVALID
Alias: None
Product: binutils
Classification: Unclassified
Component: ld (show other bugs)
Version: 2.22
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-01-20 23:04 UTC by Bharath
Modified: 2017-01-21 11:48 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bharath 2017-01-20 23:04:37 UTC
Hi ,

I am trying to create static link of dynamic objects & archives.


Below is the commands & flags used,getting below errors.

/local/mnt/workspace/bharath/AGL/poky/build/tmp-glibc/sysroots/x86_64-linux/usr/bin/aarch64-poky-linux/aarch64-poky-linux-gcc --sysroot=/local/mnt/workspace/bharath/AGL/poky/build/tmp-glibc/sysroots/auto --disable-shared -Wundef -Wstrict-prototypes -Wno-trigraphs -g -O0 -fno-inline -fno-short-enums -fpic -D_GNU_SOURCE -I.. -O2 -pipe -g -feliminate-unused-debug-types -fstack-protector-all -pie -fpie -D_FORTIFY_SOURCE=2 -static -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -Wl,-z -Wl,relro -Wl,-z -Wl,now -o applypatch applypatch-applypatch.o applypatch-bspatch.o applypatch-bsdiff.o applypatch-imgpatch.o applypatch-freecache.o applypatch-utils.o applypatch-main.o  -lz /local/mnt/workspace/bharath/AGL/poky/build/tmp-glibc/sysroots/auto/usr/lib64/libbz2.a /local/mnt/workspace/bharath/AGL/poky/build/tmp-glibc/sysroots/auto/usr/lib64/libmincrypt.a /local/mnt/workspace/bharath/AGL/poky/build/tmp-glibc/sysroots/auto/usr/lib64/libcutils.so /local/mnt/workspace/bharath/AGL/poky/build/tmp-glibc/sysroots/auto/usr/lib64/liblog.so /local/mnt/workspace/bharath/AGL/poky/build/tmp-glibc/sysroots/auto/usr/lib64/libglib-2.0.so /local/mnt/workspace/bharath/AGL/poky/build/tmp-glibc/sysroots/auto/usr/lib64/libstdc++.a ../mtdutils/.libs/libmtdutils.a ../edify/.libs/libedify.a ../minzip/.libs/libminzip.a -lm -lpthread
/local/mnt/workspace/bharath/AGL/poky/build/tmp-glibc/sysroots/x86_64-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/4.9.3/ld: attempted static link of dynamic object `/local/mnt/workspace/bharath/AGL/poky/build/tmp-glibc/sysroots/auto/usr/lib64/libcutils.so'
collect2: error: ld returned 1 exit status

Is there any switch to override this?

Regards
Bharath
Comment 1 Bharath 2017-01-20 23:38:34 UTC
we have to remove static flag