How to avoid SO and ELF file dependencies in yocto SDK?

77 views Asked by At

Backtsory:

I have updated the whole Yocto from Dunfell to Kirkstone, and the normal images are working as expected. We are using commonapi version 3.1.12.4 and for some reasons we cannot update it.

But in SDK, we are using commonapi version 3.1.12.4, it was compatible with GLIBC 2.31 (kirkstone), but it is not compatible with new GLIBC 2.35 (kirkstone). This is the error that I am facing.

  - nothing provides libpthread.so.0 needed by nativesdk-capicxx-core-3.1.12.4-r0.x86_64_nativesdk
  - nothing provides libdl.so.2 needed by nativesdk-capicxx-core-3.1.12.4-r0.x86_64_nativesdk
  - nothing provides libc.so.6(GLIBC_2.3) needed by nativesdk-capicxx-core-3.1.12.4-r0.x86_64_nativesdk
  - nothing provides libdl.so.2(GLIBC_2.0) needed by nativesdk-capicxx-core-3.1.12.4-r0.x86_64_nativesdk
  - nothing provides libdl.so.2(GLIBC_2.1) needed by nativesdk-capicxx-core-3.1.12.4-r0.x86_64_nativesdk
  - nothing provides libpthread.so.0(GLIBC_2.0) needed by nativesdk-capicxx-core-3.1.12.4-r0.x86_64_nativesdk
  - nothing provides libpthread.so.0(GLIBC_2.1) needed by nativesdk-capicxx-core-3.1.12.4-r0.x86_64_nativesdk
  - nothing provides libpthread.so.0(GLIBC_2.1.1) needed by nativesdk-capicxx-core-3.1.12.4-r0.x86_64_nativesdk

As can be seen, problem is with libdl, libc, and libpthread. Now, they GLIBC is saying that their changes are backward compatible, hence, I am sure we can make these new so files from GLIBC 2.35 work with older commonapi which needs GLIBC 2.31.

Now, I can ignore this error on the nativesdk-capicxx-core itself by either using INSANE_SKIP:${PN} += "file-rdeps" or do_package_qa[noexec] = "1" and it gets built even though the so files are not there. It creates an RPM file that is later used for the SDK.

But when creating SDK, I cannot ignore this with any variable that is workable on the target image.

I have tried to edit ELF files of this recipe and I was able to get rid of libpthread.so.0 and libdl.so.2, but all others (which are with GLIBC title) are needed by another .so file name eclipse_1605.so. Hence, it is nearly impossible for me to ignore this because apparently DNF checks for all the dependencies before making an SDK. I was able to remove the dependencies from ELF file but I do not even think that removing dependencies from the SO files will work.

Following are the commands that is being used and they work to resolve 2 error out of 8.

patchelf --remove-needed "libpthread.so.0" commonapi-generator-linux-x86_64 && \
patchelf --remove-needed "libdl.so.2" commonapi-generator-linux-x86_64 && \
patchelf --remove-needed "libc.so.6" commonapi-generator-linux-x86_64 && \
patchelf --remove-needed "libpthread.so.0" plugins/org.eclipse.equinox.launcher.gtk.linux.x86_1.1.200.v20140603-1326/eclipse_1605.so && \
patchelf --remove-needed "libdl.so.2" plugins/org.eclipse.equinox.launcher.gtk.linux.x86_1.1.200.v20140603-1326/eclipse_1605.so && \
patchelf --remove-needed "libc.so.6" plugins/org.eclipse.equinox.launcher.gtk.linux.x86_1.1.200.v20140603-1326/eclipse_1605.so && \
patchelf --remove-needed "libpthread.so.0" plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.200.v20140603-1326/eclipse_1605.so && \
patchelf --remove-needed "libdl.so.2" plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.200.v20140603-1326/eclipse_1605.so && \
patchelf --remove-needed "libc.so.6" plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.200.v20140603-1326/eclipse_1605.so && \
patchelf --remove-needed "libc.so.6(GLIBC_2.3)" commonapi-generator-linux-x86_64 && \
patchelf --remove-needed "libdl.so.2(GLIBC_2.0)" commonapi-generator-linux-x86_64 && \
patchelf --remove-needed "libdl.so.2(GLIBC_2.1)" commonapi-generator-linux-x86_64 && \
patchelf --remove-needed "libpthread.so.0(GLIBC_2.0)" commonapi-generator-linux-x86_64 && \
patchelf --remove-needed "libpthread.so.0(GLIBC_2.1)" commonapi-generator-linux-x86_64 && \
patchelf --remove-needed "libpthread.so.0(GLIBC_2.1.1)" commonapi-generator-linux-x86_64

Also, here is the objdump file of eclipse_1605.so file so know that there are some sort of marker inside the file too.

objdump -T plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.200.v20140603-1326/eclipse_1605.so
plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.200.v20140603-1326/eclipse_1605.so: file format elf64-x86-64
DYNAMIC SYMBOL TABLE:
0000000000003d10 l d .init 0000000000000000 .init
0000000000004450 l d .text 0000000000000000 .text
000000000000cfe8 l d .fini 0000000000000000 .fini
000000000000cff8 l d .rodata 0000000000000000 .rodata
000000000000df38 l d .eh_frame_hdr 0000000000000000 .eh_frame_hdr
000000000000e290 l d .eh_frame 0000000000000000 .eh_frame
000000000010f000 l d .ctors 0000000000000000 .ctors
000000000010f010 l d .dtors 0000000000000000 .dtors
000000000010f020 l d .jcr 0000000000000000 .jcr
000000000010f620 l d .data 0000000000000000 .data
0000000000110040 l d .bss 0000000000000000 .bss
0000000000000000 DF *UND* 0000000000000082 (GLIBC_2.2.5) strcasecmp
0000000000110048 g DO .bss 0000000000000008 Base exitData
0000000000000000 DF *UND* 00000000000003cd (GLIBC_2.2.5) execvp
000000000000b654 g DF .text 00000000000001b5 Base isSunVM
000000000010fb10 g DO .data 0000000000000008 Base wsArg
0000000000007e09 g DF .text 0000000000000163 Base executeWithLock
0000000000000000 DF *UND* 0000000000000005 (GLIBC_2.2.5) fork
0000000000008d77 g DF .text 000000000000001c Base concatStrings
000000000000b8d0 g DF .text 000000000000028f Base readConfigFile
000000000000946c g DF .text 000000000000001c Base Java_org_eclipse_equinox_launcher_JNIBridge__1get_1splash_1handle
0000000000009002 g DF .text 00000000000000e1 Base containsPaths
0000000000008c0d g DF .text 000000000000016a Base checkPathList
0000000000000000 DF *UND* 0000000000000082 (GLIBC_2.2.5) closedir
0000000000000000 DF *UND* 000000000000004d (GLIBC_2.2.5) __xstat
0000000000009450 g DF .text 000000000000001c Base Java_org_eclipse_equinox_launcher_JNIBridge__1update_1splash
00000000000088da g DF .text 0000000000000019 Base getArgVM
000000000010f028 g DO *ABS* 0000000000000000 Base _DYNAMIC
000000000000b0aa g DF .text 00000000000000df Base getSharedData
0000000000000000 DF *UND* 0000000000000019 (GLIBC_2.2.5) sem_close
000000000000be3b g DF .text 000000000000001c Base findCommand
000000000000cbd0 g DF .text 000000000000001f Base findSymbol
0000000000008b0f g DF .text 00000000000000fe Base checkProvidedVMType
0000000000000000 DF *UND* 0000000000000027 (GLIBC_2.2.5) pipe
0000000000000000 DF *UND* 00000000000000dd (GLIBC_2.2.5) getenv
000000000000b61b g DF .text 000000000000000a Base processVMArgs
0000000000000000 DF *UND* 0000000000000212 (GLIBC_2.2.5) malloc
0000000000000000 DF *UND* 00000000000000e7 (GLIBC_2.2.5) strncmp
0000000000008e8c g DF .text 00000000000000fd Base concatArgs
0000000000008889 g DF .text 000000000000000d Base getSplashHandle
0000000000000000 DF *UND* 00000000000001a9 (GLIBC_2.2.5) sigaction
00000000000079b1 g DF .text 0000000000000392 Base getVMLibrarySearchPath
0000000000000000 DF *UND* 0000000000000128 (GLIBC_2.2.5) sem_post
0000000000000000 DF *UND* 0000000000000098 (GLIBC_2.2.5) strncpy
000000000000b80c g DF .text 0000000000000074 Base readIniFile
000000000010f948 g DO .data 0000000000000008 Base defaultVM
000000000000c9b1 g DF .text 00000000000001c4 Base initWindowSystem
0000000000008257 g DF .text 0000000000000229 Base createLauncherWindow
0000000000000000 DF *UND* 000000000000007a (GLIBC_2.2.5) nanosleep
000000000000b5da g DF .text 0000000000000041 Base restartLauncher
0000000000000000 DF *UND* 00000000000001a5 (GLIBC_2.2.5) fclose
0000000000000000 DO *UND* 0000000000000008 (GLIBC_2.2.5) stderr
0000000000000000 DF *UND* 000000000000004c (GLIBC_2.2.5) dlopen
00000000000044ec g DF .text 0000000000000039 Base setInitialArgs
0000000000000000 DF *UND* 0000000000000027 (GLIBC_2.2.5) shmdt
0000000000003d10 g DF .init 0000000000000000 Base _init
000000000010f958 g DO .data 0000000000000008 Base shippedVMDir
0000000000000000 DF *UND* 00000000000000e9 (GLIBC_2.2.5) strlen
0000000000000000 DF *UND* 0000000000000068 (GLIBC_2.2.5) sem_trywait
000000000000be24 g DF .text 0000000000000017 Base toNarrow
0000000000110328 g DO .bss 0000000000000004 Base initialArgc
000000000000be57 g DF .text 000000000000033f Base findSymlinkCommand
0000000000000000 DF *UND* 0000000000000078 (GLIBC_2.2.5) setenv
0000000000006498 g DF .text 0000000000000084 Base getProgramDir
0000000000000000 DF *UND* 00000000000000dc (GLIBC_2.2.5) strcpy
00000000000093a4 g DF .text 00000000000000ac Base Java_org_eclipse_equinox_launcher_JNIBridge__1set_1launcher_1info
0000000000000000 DF *UND* 000000000000008e (GLIBC_2.2.5) fprintf
0000000000000000 DF *UND* 0000000000000066 (GLIBC_2.2.5) memcpy
000000000000b625 g DF .text 000000000000002f Base startJavaVM
0000000000000000 DF *UND* 000000000000005e (GLIBC_2.2.5) strtol
0000000000000000 DF *UND* 0000000000000173 (GLIBC_2.2.5) fgets
0000000000000000 DF *UND* 0000000000000022 (GLIBC_2.2.5) strcmp
000000000000b189 g DF .text 00000000000000b3 Base setSharedData
0000000000000000 DF *UND* 0000000000000223 (GLIBC_2.2.5) scandir
0000000000000000 DF *UND* 00000000000003b7 (GLIBC_2.2.5) realloc
000000000000c371 g DF .text 000000000000028d Base findFile
0000000000000000 DF *UND* 0000000000000061 (GLIBC_2.2.5) _exit
00000000000088f3 g DF .text 0000000000000123 Base launchJavaVM
000000000000b23c g DF .text 000000000000002f Base findVMLibrary
0000000000000000 DF *UND* 0000000000000027 (GLIBC_2.2.5) shmget
0000000000006406 g DF .text 000000000000000d Base getProgramPath
000000000000a9a8 g DF .text 00000000000001c8 Base filter
0000000000000000 DF *UND* 000000000000008e (GLIBC_2.2.5) sscanf
0000000000000000 DF *UND* 000000000000021a (GLIBC_2.2.5) fdopen
000000000000bb5f g DF .text 0000000000000061 Base freeConfig
0000000000000000 DF *UND* 0000000000000182 (GLIBC_2.2.5) sleep
0000000000000000 DF *UND* 0000000000000163 (GLIBC_2.2.5) opendir
00000000000090e3 g DF .text 000000000000009b Base isVMLibrary
0000000000000000 DF *UND* 0000000000000013 (GLIBC_2.2.5) alphasort
00000000000063e4 g DF .text 000000000000000d Base getOfficialName
000000000000819f g DF .text 000000000000007c Base setAppWindowProperty
0000000000000000 DF *UND* 00000000000000a0 (GLIBC_2.2.5) printf
0000000000110058 g DO .bss 0000000000000004 Base secondThread
000000000000a706 g DF .text 0000000000000182 Base cleanupVM
0000000000000000 DF *UND* 000000000000000f (GLIBC_2.2.5) execv
000000000000924c g DF .text 0000000000000158 Base Java_org_eclipse_equinox_launcher_JNIBridge__1set_1exit_1data
0000000000000000 DF *UND* 0000000000000027 (GLIBC_2.2.5) shmat
000000000000c8f8 g DF .text 00000000000000b9 Base displayMessage
0000000000110038 g D *ABS* 0000000000000000 Base __bss_start
0000000000000000 DF *UND* 0000000000000017 (GLIBC_2.2.5) atoi
0000000000000000 DF *UND* 0000000000000036 (GLIBC_2.2.5) dlclose
000000000000cbb9 g DF .text 0000000000000017 Base unloadLibrary
0000000000000000 w DF *UND* 0000000000000109 (GLIBC_2.2.5) __cxa_finalize
0000000000000000 DF *UND* 00000000000001a2 (GLIBC_2.2.5) strchr
0000000000000000 DF *UND* 00000000000000f2 (GLIBC_2.2.5) memset
000000000000c6cd g DF .text 00000000000001e6 Base checkPath
000000000000cfe8 g DF .fini 0000000000000000 Base _fini
000000000010fb08 g DO .data 0000000000000008 Base osArchArg
0000000000008852 g DF .text 0000000000000037 Base dispatchMessages
0000000000004525 g DF .text 0000000000000032 Base run
000000000010fb19 g DO .data 0000000000000001 Base pathSeparator
000000000000c8b3 g DF .text 0000000000000021 Base lastDirSeparator
0000000000000000 DF *UND* 000000000000000a (GLIBC_2.2.5) getpid
0000000000000000 DF *UND* 0000000000000027 (GLIBC_2.2.5) dup2
0000000000000000 DF *UND* 000000000000003d (GLIBC_2.2.5) strrchr
0000000000006413 g DF .text 0000000000000015 Base setProgramPath
0000000000000000 DF *UND* 00000000000000b8 (GLIBC_2.2.5) waitpid
0000000000000000 DF *UND* 00000000000000c5 (GLIBC_2.2.5) exit
000000000000c196 g DF .text 0000000000000076 Base resolveSymlinks
0000000000008a18 g DF .text 00000000000000f7 Base isJ9VM
000000000000ccd3 g DF .text 00000000000002c4 Base loadGtk
0000000000000000 DF *UND* 0000000000000205 (GLIBC_2.2.5) dlerror
0000000000000000 DF *UND* 000000000000008a (GLIBC_2.2.5) dlsym
0000000000000000 DF *UND* 0000000000000054 (GLIBC_2.2.5) strdup
0000000000000000 DF *UND* 0000000000000120 (GLIBC_2.2.5) getcwd
0000000000000000 DF *UND* 000000000000008e (GLIBC_2.2.5) sprintf
0000000000000000 DF *UND* 0000000000000031 (GLIBC_2.2.5) raise
000000000000b069 g DF .text 0000000000000041 Base destroySharedData
0000000000000000 DF *UND* 00000000000000f5 (GLIBC_2.2.5) readdir
000000000000cb75 g DF .text 0000000000000044 Base loadLibrary
0000000000008f89 g DF .text 0000000000000079 Base indexOf
0000000000009488 g DF .text 000000000000008e Base Java_org_eclipse_equinox_launcher_JNIBridge__1show_1splash
0000000000110038 g D *ABS* 0000000000000000 Base _edata
000000000010f280 g DO *ABS* 0000000000000000 Base _GLOBAL_OFFSET_TABLE_
0000000000110330 g D *ABS* 0000000000000000 Base _end
0000000000000000 DF *UND* 0000000000000070 (GLIBC_2.2.5) close
0000000000000000 DF *UND* 000000000000000a (GLIBC_2.2.5) __errno_location
0000000000000000 DF *UND* 0000000000000057 (GLIBC_2.2.5) sem_open
0000000000009bc4 g DF .text 0000000000000645 Base startJavaJNI
000000000000861c g DF .text 0000000000000236 Base showSplash
0000000000000000 DF *UND* 0000000000000109 (GLIBC_2.2.5) free
0000000000000000 DF *UND* 000000000000000a (GLIBC_2.2.5) fopen
0000000000008480 g DF .text 000000000000019c Base reuseWorkbench
0000000000008d93 g DF .text 00000000000000f9 Base concatPaths
0000000000110060 g DO .bss 0000000000000008 Base eeLibPath
00000000000063f1 g DF .text 0000000000000015 Base setOfficialName
000000000000b880 g DF .text 0000000000000050 Base getIniFile
000000000010f950 g DO .data 0000000000000008 Base vmLibrary
0000000000000000 DF *UND* 00000000000000c3 (GLIBC_2.2.5) strstr
0000000000000000 DF *UND* 00000000000003ff (GLIBC_2.3) realpath
000000000000917e g DF .text 00000000000000ce Base versionCmp
000000000000af94 g DF .text 0000000000000094 Base createSharedData
0000000000000000 w D *UND* 0000000000000000 _Jv_RegisterClasses
000000000000ab70 g DF .text 0000000000000422 Base fixEnvForMozilla
0000000000000000 DF *UND* 0000000000000027 (GLIBC_2.2.5) shmctl
0000000000008896 g DF .text 0000000000000044 Base takeDownSplash
0000000000110068 g DO .bss 0000000000000008 Base eclipseLibrary
0000000000110050 g DO .bss 0000000000000008 Base initialArgv
000000000010fb20 g DO .data 0000000000000128 Base gtk
0000000000000000 DF *UND* 00000000000001bc (GLIBC_2.2.5) strcat
0000000000009516 g DF .text 000000000000001c Base Java_org_eclipse_equinox_launcher_JNIBridge__1takedown_1splash
000000000010fb00 g DO .data 0000000000000008 Base osArg
0000000000110318 g DO .bss 0000000000000004 Base gtkInitialized
000000000010fb18 g DO .data 0000000000000001 Base dirSeparator
0000000000000000 w D *UND* 0000000000000000 __gmon_start__
000000000000c8d4 g DF .text 0000000000000021 Base firstDirSeparator

I have following questions:

Is there any way to tell DNF to not look for dependencies in SDK?

Can we even ignore dependencies in SDK?

What if I make another folder inside /lib/ puts the required dependencies from older version of GLIBC, edit the ld.so.conf file in /etc and put the new path there. It will make a conflict later on though because then packages that requires new GLIBC will also be looking into that folder and not just commonapi alone.

Is there any way in general for us to tell one particular ELF file or package to only look for your dependencies in a particular folder rather than /lib?

I have also tried to edit the .spec file of RPM but the dependencies are being read from inside SO and ELF files and not the .spec file

0

There are 0 answers