Re: [Rpm-maint] [rpm-software-management/rpm] debugedit.c patches (#171)

2017-03-05 Thread ニール・ゴンパ
@n3npq For what it's worth, to make it all unformatted text, use ` ``` ` at the 
top of the block, and ` ``` `  at the bottom of the block. That way, it looks 
like patches or code. :)

In addition, you can tell it to be diff style by doing ` ```diff ` for the top 
of the block.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/171#issuecomment-284303806___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] debug edit build generation is endian dependent when cross-compiling? (#171)

2017-03-05 Thread Jeff Johnson
debugedit.c --help can be improved (and potentially internationalized)

*shrug*

@@ -1323,16 +1290,15 @@

 static struct poptOption optionsTable[] = {
   { "base-dir",  'b', POPT_ARG_STRING, _dir, 0,
-N_("base build DIRECTORY of objects"), N_("DIRECTORY") },
+  "base build directory of objects", NULL },
   { "dest-dir",  'd', POPT_ARG_STRING, _dir, 0,
-N_("DIRECTORY to rewrite base-dir into"), N_("DIRECTORY") },
+  "directory to rewrite base-dir into", NULL },
   { "list-file",  'l', POPT_ARG_STRING, _file, 0,
-N_("FILE where to put list of source and header file names"), N_("FILE") },
+  "file where to put list of source and header file names", NULL },
   { "build-id",  'i', POPT_ARG_NONE, _build_id, 0,
-N_("recompute build-id note and print on stdout"), NULL },
+  "recompute build ID note and print ID on stdout", NULL },
   { "build-id-seed", 's', POPT_ARG_STRING, _id_seed, 0,
-N_("if recomputing the build-id note, use this string as hash SEED"), 
N_("SEED") },
-
+  "if recomputing the build ID note use this string as hash seed", NULL },
 POPT_AUTOHELP
   { NULL, 0, 0, NULL, 0, NULL, NULL }
 };


-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/171#issuecomment-284247465___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] debug edit build generation is endian dependent when cross-compiling? (#171)

2017-03-05 Thread Jeff Johnson
Portability of debugedit.c on systems that do not support #include  
(solaris, *BSD) can be achieved by duplicating certain DWARF standard constants:

-#ifndef EM_AARCH64
-#define EM_AARCH64  183 /* ARM AARCH64 */
-#endif
-#ifndef R_AARCH64_ABS32
-#define R_AARCH64_ABS32 258
-#endif 
-
-/* some defines taken from the dwarf standard */
-
-#define DW_TAG_compile_unit0x11
-
-#define DW_AT_name 0x03
-#define DW_AT_stmt_list0x10
-#define DW_AT_comp_dir 0x1b
-
-#define DW_FORM_addr   0x01
-#define DW_FORM_block2 0x03
-#define DW_FORM_block4 0x04
-#define DW_FORM_data2  0x05
-#define DW_FORM_data4  0x06
-#define DW_FORM_data8  0x07
-#define DW_FORM_string 0x08
-#define DW_FORM_block  0x09
-#define DW_FORM_block1 0x0a
-#define DW_FORM_data1  0x0b
-#define DW_FORM_flag   0x0c
-#define DW_FORM_sdata  0x0d
-#define DW_FORM_strp   0x0e
-#define DW_FORM_udata  0x0f
-#define DW_FORM_ref_addr   0x10
-#define DW_FORM_ref1   0x11
-#define DW_FORM_ref2   0x12
-#define DW_FORM_ref4   0x13
-#define DW_FORM_ref8   0x14
-#define DW_FORM_ref_udata  0x15
-#define DW_FORM_indirect   0x16


-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/171#issuecomment-284247337___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] debug edit build generation is endian dependent when cross-compiling? (#171)

2017-03-05 Thread Jeff Johnson
For rpm portability with older versions of elfutils, this harmless sanity check 
might be useful:

(excuse the different hash functions in use in the patch snippet below)
@@ -1533,40 +1493,12 @@
   /* Now format the build ID bits in hex to print out.  */
   {   
 const uint8_t * id = (uint8_t *)build_id->d_buf + build_id_offset;
-char hex[build_id_size * 2 + 1];
-int n = snprintf (hex, 3, "%02" PRIx8, id[0]);
-assert (n == 2);
-for (i = 1; i < (int)build_id_size; ++i)
-  {
-   n = snprintf ([i * 2], 3, "%02" PRIx8, id[i]);
-   assert (n == 2);
-  }
+char *hex = pgpHexStr(id, build_id_size);
 puts (hex);
+free(hex);
   }   
 }
 
-/* It avoided the segment fault while file's bss offset have a large number.
-   See https://bugzilla.redhat.com/show_bug.cgi?id=1019707
-   https://bugzilla.redhat.com/show_bug.cgi?id=1020842 for detail. */
-void valid_file(int fd)
-{
-  Elf *elf = elf_begin (fd, ELF_C_RDWR, NULL);
-  if (elf == NULL)
-  {
-error (1, 0, "elf_begin: %s", elf_errmsg (-1));
-return;
-  }
-
-  elf_flagelf (elf, ELF_C_SET, ELF_F_LAYOUT);
-
-  if (elf_update (elf, ELF_C_WRITE) < 0)
-error (1, 0, "elf_update: %s", elf_errmsg (-1));
-
-  elf_end (elf);
-
-  return;
-}
-
 int
 main (int argc, char *argv[])
 {
@@ -1682,9 +1614,6 @@
   exit (1);
 }

-  /* Make sure the file is valid. */
-  valid_file(fd);
-
   dso = fdopen_dso (fd, file);
   if (dso == NULL)
 exit (1);


-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/171#issuecomment-284246637___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


[Rpm-maint] [rpm-software-management/rpm] debug edit build generation is endian dependent when cross-compiling? (#171)

2017-03-05 Thread Jeff Johnson
rpm5.org carries this patch from Yocto:
  https://patchwork.openembedded.org/patch/46887
which likely should be added when updating debug edit.c soon.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/171___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint