Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Fix ABI on dragonfly
John Marino committed 13 years ago
commit 94c4931c53a531e77b0e2f3e2ecbe96c98fb119d
parent 883905f
1 file changed +7 -1
modified libpkg/pkg_elf.c
@@ -329,7 +329,8 @@ analyse_elf(struct pkg *pkg, const char *fpath,
	if (note != NULL) {
		data = elf_getdata(note, NULL);
		osname = (const char *) data->d_buf + sizeof(Elf_Note);
-
		if (strncasecmp(osname, "freebsd", sizeof("freebsd")) != 0) {
+
		if (strncasecmp(osname, "freebsd", sizeof("freebsd")) != 0 &&
+
		    strncasecmp(osname, "dragonfly", sizeof("dragonfly")) != 0) {
			ret = EPKG_END;	/* Foreign (probably linux) ELF object */
			goto cleanup;
		}
@@ -612,8 +613,13 @@ pkg_get_myarch(char *dest, size_t sz)
	wordsize_corres_str = elf_corres_to_string(wordsize_corres,
	    (int)elfhdr.e_ident[EI_CLASS]);

+
#if defined(__DragonFly__)
+
	snprintf(dest, sz, "%s:%d.%d:%s:%s",
+
	    osname, version / 100000, (((version / 100 % 1000)+1)/2)*2,
+
#else
	snprintf(dest, sz, "%s:%d:%s:%s",
	    osname, version / 100000,
+
#endif
	    elf_corres_to_string(mach_corres, (int) elfhdr.e_machine),
	    wordsize_corres_str);