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

Compilation error: /usr/bin/ld: failed to set dynamic section sizes: bad value #2

Open
fantomfp opened this issue Jan 31, 2023 · 2 comments

Comments

@fantomfp
Copy link

Version: 2022.27

make commande-line:

/usr/bin/make -O -j8 V=1 VERBOSE=1 OPT='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64  -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection' USRLIBDIR=/usr/lib64 ROOTLIBDIR=/lib64

Short error:

/usr/bin/ld: ../bin/Linux.x86_64/mined1.o: relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: failed to set dynamic section sizes: bad value
collect2: error: ld returned 1 exit status
gmake[1]: *** [mkinclud.mak:641: ../bin/Linux.x86_64/mined] Error 1
make: *** [makefile:9: mined] Error 2

I tried to add -fPIE but it's not fixing the issue.

Fedora 37 + gcc 12.2.1 + x86_64

Long output:

/usr/bin/ld: /tmp/ccPNZYeb.o: in function `main':
insutf8ch.c:(.text+0x60e): warning: the `gets' function is dangerous and should not be used.
extract ideographs with radical 1
extract ideographs with radical 2
extract ideographs with radical 3
extract ideographs with radical 4
extract ideographs with radical 5
extract ideographs with radical 6
extract ideographs with radical 7
extract ideographs with radical 8
extract ideographs with radical 9
extract ideographs with radical 10
extract ideographs with radical 11
extract ideographs with radical 12
extract ideographs with radical 13
extract ideographs with radical 14
extract ideographs with radical 15
extract ideographs with radical 16
extract ideographs with radical 17
extract ideographs with radical 18
extract ideographs with radical 19
extract ideographs with radical 20
extract ideographs with radical 21
extract ideographs with radical 22
extract ideographs with radical 23
extract ideographs with radical 24
extract ideographs with radical 25
extract ideographs with radical 26
extract ideographs with radical 27
extract ideographs with radical 28
extract ideographs with radical 29
extract ideographs with radical 30
extract ideographs with radical 31
extract ideographs with radical 32
extract ideographs with radical 33
extract ideographs with radical 34
extract ideographs with radical 35
extract ideographs with radical 36
extract ideographs with radical 37
extract ideographs with radical 38
extract ideographs with radical 39
extract ideographs with radical 40
extract ideographs with radical 41
extract ideographs with radical 42
extract ideographs with radical 43
extract ideographs with radical 44
extract ideographs with radical 45
extract ideographs with radical 46
extract ideographs with radical 47
extract ideographs with radical 48
extract ideographs with radical 49
extract ideographs with radical 50
extract ideographs with radical 51
extract ideographs with radical 52
extract ideographs with radical 53
extract ideographs with radical 54
extract ideographs with radical 55
extract ideographs with radical 56
extract ideographs with radical 57
extract ideographs with radical 58
extract ideographs with radical 59
extract ideographs with radical 60
extract ideographs with radical 61
extract ideographs with radical 62
extract ideographs with radical 63
extract ideographs with radical 64
extract ideographs with radical 65
extract ideographs with radical 66
extract ideographs with radical 67
extract ideographs with radical 68
extract ideographs with radical 69
extract ideographs with radical 70
extract ideographs with radical 71
extract ideographs with radical 72
extract ideographs with radical 73
extract ideographs with radical 74
extract ideographs with radical 75
extract ideographs with radical 76
extract ideographs with radical 77
extract ideographs with radical 78
extract ideographs with radical 79
extract ideographs with radical 80
extract ideographs with radical 81
extract ideographs with radical 82
extract ideographs with radical 83
extract ideographs with radical 84
extract ideographs with radical 85
extract ideographs with radical 86
extract ideographs with radical 87
extract ideographs with radical 88
extract ideographs with radical 89
extract ideographs with radical 90
extract ideographs with radical 91
extract ideographs with radical 92
extract ideographs with radical 93
extract ideographs with radical 94
extract ideographs with radical 95
extract ideographs with radical 96
extract ideographs with radical 97
extract ideographs with radical 98
extract ideographs with radical 99
extract ideographs with radical 100
extract ideographs with radical 101
extract ideographs with radical 102
extract ideographs with radical 103
extract ideographs with radical 104
extract ideographs with radical 105
extract ideographs with radical 106
extract ideographs with radical 107
extract ideographs with radical 108
extract ideographs with radical 109
extract ideographs with radical 110
extract ideographs with radical 111
extract ideographs with radical 112
extract ideographs with radical 113
extract ideographs with radical 114
extract ideographs with radical 115
extract ideographs with radical 116
extract ideographs with radical 117
extract ideographs with radical 118
extract ideographs with radical 119
extract ideographs with radical 120
extract ideographs with radical 121
extract ideographs with radical 122
extract ideographs with radical 123
extract ideographs with radical 124
extract ideographs with radical 125
extract ideographs with radical 126
extract ideographs with radical 127
extract ideographs with radical 128
extract ideographs with radical 129
extract ideographs with radical 130
extract ideographs with radical 131
extract ideographs with radical 132
extract ideographs with radical 133
extract ideographs with radical 134
extract ideographs with radical 135
extract ideographs with radical 136
extract ideographs with radical 137
extract ideographs with radical 138
extract ideographs with radical 139
extract ideographs with radical 140
extract ideographs with radical 141
extract ideographs with radical 142
extract ideographs with radical 143
extract ideographs with radical 144
extract ideographs with radical 145
extract ideographs with radical 146
extract ideographs with radical 147
extract ideographs with radical 148
extract ideographs with radical 149
extract ideographs with radical 150
extract ideographs with radical 151
extract ideographs with radical 152
extract ideographs with radical 153
extract ideographs with radical 154
extract ideographs with radical 155
extract ideographs with radical 156
extract ideographs with radical 157
extract ideographs with radical 158
extract ideographs with radical 159
extract ideographs with radical 160
extract ideographs with radical 161
extract ideographs with radical 162
extract ideographs with radical 163
extract ideographs with radical 164
extract ideographs with radical 165
extract ideographs with radical 166
extract ideographs with radical 167
extract ideographs with radical 168
extract ideographs with radical 169
extract ideographs with radical 170
extract ideographs with radical 171
extract ideographs with radical 172
extract ideographs with radical 173
extract ideographs with radical 174
extract ideographs with radical 175
extract ideographs with radical 176
extract ideographs with radical 177
extract ideographs with radical 178
extract ideographs with radical 179
extract ideographs with radical 180
extract ideographs with radical 181
extract ideographs with radical 182
extract ideographs with radical 183
extract ideographs with radical 184
extract ideographs with radical 185
extract ideographs with radical 186
extract ideographs with radical 187
extract ideographs with radical 188
extract ideographs with radical 189
extract ideographs with radical 190
extract ideographs with radical 191
extract ideographs with radical 192
extract ideographs with radical 193
extract ideographs with radical 194
extract ideographs with radical 195
extract ideographs with radical 196
extract ideographs with radical 197
extract ideographs with radical 198
extract ideographs with radical 199
extract ideographs with radical 200
extract ideographs with radical 201
extract ideographs with radical 202
extract ideographs with radical 203
extract ideographs with radical 204
extract ideographs with radical 205
extract ideographs with radical 206
extract ideographs with radical 207
extract ideographs with radical 208
extract ideographs with radical 209
extract ideographs with radical 210
extract ideographs with radical 211
extract ideographs with radical 212
extract ideographs with radical 213
extract ideographs with radical 214
collect ideographs with radical 1
collect ideographs with radical 2
collect ideographs with radical 3
collect ideographs with radical 4
collect ideographs with radical 5
collect ideographs with radical 6
collect ideographs with radical 7
collect ideographs with radical 8
collect ideographs with radical 9
collect ideographs with radical 10
collect ideographs with radical 11
collect ideographs with radical 12
collect ideographs with radical 13
collect ideographs with radical 14
collect ideographs with radical 15
collect ideographs with radical 16
collect ideographs with radical 17
collect ideographs with radical 18
collect ideographs with radical 19
collect ideographs with radical 20
collect ideographs with radical 21
collect ideographs with radical 22
collect ideographs with radical 23
collect ideographs with radical 24
collect ideographs with radical 25
collect ideographs with radical 26
collect ideographs with radical 27
collect ideographs with radical 28
collect ideographs with radical 29
collect ideographs with radical 30
collect ideographs with radical 31
collect ideographs with radical 32
collect ideographs with radical 33
collect ideographs with radical 34
collect ideographs with radical 35
collect ideographs with radical 36
collect ideographs with radical 37
collect ideographs with radical 38
collect ideographs with radical 39
collect ideographs with radical 40
collect ideographs with radical 41
collect ideographs with radical 42
collect ideographs with radical 43
collect ideographs with radical 44
collect ideographs with radical 45
collect ideographs with radical 46
collect ideographs with radical 47
collect ideographs with radical 48
collect ideographs with radical 49
collect ideographs with radical 50
collect ideographs with radical 51
collect ideographs with radical 52
collect ideographs with radical 53
collect ideographs with radical 54
collect ideographs with radical 55
collect ideographs with radical 56
collect ideographs with radical 57
collect ideographs with radical 58
collect ideographs with radical 59
collect ideographs with radical 60
collect ideographs with radical 61
collect ideographs with radical 62
collect ideographs with radical 63
collect ideographs with radical 64
collect ideographs with radical 65
collect ideographs with radical 66
collect ideographs with radical 67
collect ideographs with radical 68
collect ideographs with radical 69
collect ideographs with radical 70
collect ideographs with radical 71
collect ideographs with radical 72
collect ideographs with radical 73
collect ideographs with radical 74
collect ideographs with radical 75
collect ideographs with radical 76
collect ideographs with radical 77
collect ideographs with radical 78
collect ideographs with radical 79
collect ideographs with radical 80
collect ideographs with radical 81
collect ideographs with radical 82
collect ideographs with radical 83
collect ideographs with radical 84
collect ideographs with radical 85
collect ideographs with radical 86
collect ideographs with radical 87
collect ideographs with radical 88
collect ideographs with radical 89
collect ideographs with radical 90
collect ideographs with radical 91
collect ideographs with radical 92
collect ideographs with radical 93
collect ideographs with radical 94
collect ideographs with radical 95
collect ideographs with radical 96
collect ideographs with radical 97
collect ideographs with radical 98
collect ideographs with radical 99
collect ideographs with radical 100
collect ideographs with radical 101
collect ideographs with radical 102
collect ideographs with radical 103
collect ideographs with radical 104
collect ideographs with radical 105
collect ideographs with radical 106
collect ideographs with radical 107
collect ideographs with radical 108
collect ideographs with radical 109
collect ideographs with radical 110
collect ideographs with radical 111
collect ideographs with radical 112
collect ideographs with radical 113
collect ideographs with radical 114
collect ideographs with radical 115
collect ideographs with radical 116
collect ideographs with radical 117
collect ideographs with radical 118
collect ideographs with radical 119
collect ideographs with radical 120
collect ideographs with radical 121
collect ideographs with radical 122
collect ideographs with radical 123
collect ideographs with radical 124
collect ideographs with radical 125
collect ideographs with radical 126
collect ideographs with radical 127
collect ideographs with radical 128
collect ideographs with radical 129
collect ideographs with radical 130
collect ideographs with radical 131
collect ideographs with radical 132
collect ideographs with radical 133
collect ideographs with radical 134
collect ideographs with radical 135
collect ideographs with radical 136
collect ideographs with radical 137
collect ideographs with radical 138
collect ideographs with radical 139
collect ideographs with radical 140
collect ideographs with radical 141
collect ideographs with radical 142
collect ideographs with radical 143
collect ideographs with radical 144
collect ideographs with radical 145
collect ideographs with radical 146
collect ideographs with radical 147
collect ideographs with radical 148
collect ideographs with radical 149
collect ideographs with radical 150
collect ideographs with radical 151
collect ideographs with radical 152
collect ideographs with radical 153
collect ideographs with radical 154
collect ideographs with radical 155
collect ideographs with radical 156
collect ideographs with radical 157
collect ideographs with radical 158
collect ideographs with radical 159
collect ideographs with radical 160
collect ideographs with radical 161
collect ideographs with radical 162
collect ideographs with radical 163
collect ideographs with radical 164
collect ideographs with radical 165
collect ideographs with radical 166
collect ideographs with radical 167
collect ideographs with radical 168
collect ideographs with radical 169
collect ideographs with radical 170
collect ideographs with radical 171
collect ideographs with radical 172
collect ideographs with radical 173
collect ideographs with radical 174
collect ideographs with radical 175
collect ideographs with radical 176
collect ideographs with radical 177
collect ideographs with radical 178
collect ideographs with radical 179
collect ideographs with radical 180
collect ideographs with radical 181
collect ideographs with radical 182
collect ideographs with radical 183
collect ideographs with radical 184
collect ideographs with radical 185
collect ideographs with radical 186
collect ideographs with radical 187
collect ideographs with radical 188
collect ideographs with radical 189
collect ideographs with radical 190
collect ideographs with radical 191
collect ideographs with radical 192
collect ideographs with radical 193
collect ideographs with radical 194
collect ideographs with radical 195
collect ideographs with radical 196
collect ideographs with radical 197
collect ideographs with radical 198
collect ideographs with radical 199
collect ideographs with radical 200
collect ideographs with radical 201
collect ideographs with radical 202
collect ideographs with radical 203
collect ideographs with radical 204
collect ideographs with radical 205
collect ideographs with radical 206
collect ideographs with radical 207
collect ideographs with radical 208
collect ideographs with radical 209
collect ideographs with radical 210
collect ideographs with radical 211
collect ideographs with radical 212
collect ideographs with radical 213
collect ideographs with radical 214
make[2]: Entering directory '/builddir/build/BUILD/mined-2022.27/src'
make[2]: Nothing to be done for 'keymapsk.t'.
make[2]: Leaving directory '/builddir/build/BUILD/mined-2022.27/src'
converting keymaps0/GreekMonotonic.h to optimized string format
converting keymaps0/Cyrillic.h to optimized string format
converting keymaps0/Kazakh_prefix.h to optimized string format
converting keymaps0/Hebrew.h to optimized string format
converting keymaps0/ArabicKeyboard.h to optimized string format
converting keymaps0/Amharic.h to optimized string format
converting keymaps0/Ethiopic.h to optimized string format
converting keymaps0/Esperanto.h to optimized string format
CJK keymap:
converting keymaps0/Pinyin.h to optimized string format
CJK keymap:
converting keymaps0/Cangjie.h to optimized string format
CJK keymap:
converting keymaps0/WuBi.h to optimized string format
CJK keymap:
converting keymaps0/4Corner.h to optimized string format
CJK keymap:
converting keymaps0/Boshiamy.h to optimized string format
CJK keymap:
converting keymaps0/Radical_Stroke.h to optimized string format
CJK keymap:
converting keymaps0/Bopomofo.h to optimized string format
CJK keymap:
converting keymaps0/Hiragana.h to optimized string format
CJK keymap:
converting keymaps0/Katakana.h to optimized string format
CJK keymap:
converting keymaps0/TUT_roma.h to optimized string format
CJK keymap:
converting keymaps0/HANGUL.h to optimized string format
CJK keymap:
converting keymaps0/HANJA.h to optimized string format
converting keymaps0/VNI.h to optimized string format
converting keymaps0/VIQR.h to optimized string format
converting keymaps0/th_kesmanee.h to optimized string format
converting keymaps0/Fullwidth.h to optimized string format
dispatch.c: In function 'BAD':
dispatch.c:810:30: warning: pointer targets in passing argument 2 of 'utfencode' differ in signedness [-Wpointer-sign]
  810 |         (void) utfencode (c, cbuf);
      |                              ^~~~
      |                              |
      |                              char *
In file included from mined.h:5,
                 from dispatch.c:6:
charprop.h:123:40: note: expected 'character *' {aka 'unsigned char *'} but argument is of type 'char *'
  123 | extern int utfencode _((unsigned long, character *));
      |                                        ^~~~~~~~~~~
_proto.h:24:14: note: in definition of macro '_'
   24 | #define _(x) x
      |              ^
width.c: In function 'iscombining_listed':
width.c:635:40: warning: unpaired UTF-8 bidirectional control character detected [-Wbidi-chars=]
  635 |         <U+202A> U+202A;LEFT-TO-RIGHT EMBEDDING
      |         ~~~~~~~~                               ^
      |         |                                      |
      |         U+202A (LEFT-TO-RIGHT EMBEDDING)       end of bidirectional context
width.c:636:40: warning: unpaired UTF-8 bidirectional control character detected [-Wbidi-chars=]
  636 |         <U+202B> U+202B;RIGHT-TO-LEFT EMBEDDING
      |         ~~~~~~~~                               ^
      |         |                                      |
      |         U+202B (RIGHT-TO-LEFT EMBEDDING)       end of bidirectional context
width.c:638:39: warning: unpaired UTF-8 bidirectional control character detected [-Wbidi-chars=]
  638 |         <U+202D> U+202D;LEFT-TO-RIGHT OVERRIDE
      |         ~~~~~~~~                              ^
      |         |                                     |
      |         U+202D (LEFT-TO-RIGHT OVERRIDE)       end of bidirectional context
width.c:639:39: warning: unpaired UTF-8 bidirectional control character detected [-Wbidi-chars=]
  639 |         <U+202E> U+202E;RIGHT-TO-LEFT OVERRIDE
      |         ~~~~~~~~                              ^
      |         |                                     |
      |         U+202E (RIGHT-TO-LEFT OVERRIDE)       end of bidirectional context
compose.c: In function 'lookup_prefix_char':
compose.c:182:23: warning: pointer targets in passing argument 2 of 'utfencode' differ in signedness [-Wpointer-sign]
  182 |   xp += utfencode (c, xp);
      |                       ^~
      |                       |
      |                       char *
In file included from mined.h:5,
                 from compose.c:6:
charprop.h:123:40: note: expected 'character *' {aka 'unsigned char *'} but argument is of type 'char *'
  123 | extern int utfencode _((unsigned long, character *));
      |                                        ^~~~~~~~~~~
_proto.h:24:14: note: in definition of macro '_'
   24 | #define _(x) x
      |              ^
compose.c: In function 'compose_mnemonic_mode':
compose.c:492:30: warning: pointer targets in passing argument 2 of 'utfencode' differ in signedness [-Wpointer-sign]
  492 |         m += utfencode (let, mbuf);
      |                              ^~~~
      |                              |
      |                              char *
charprop.h:123:40: note: expected 'character *' {aka 'unsigned char *'} but argument is of type 'char *'
  123 | extern int utfencode _((unsigned long, character *));
      |                                        ^~~~~~~~~~~
_proto.h:24:14: note: in definition of macro '_'
   24 | #define _(x) x
      |              ^
compose.c:495:48: warning: pointer targets in passing argument 2 of 'utfencode' differ in signedness [-Wpointer-sign]
  495 |                         m += utfencode (a [i], m);
      |                                                ^
      |                                                |
      |                                                char *
charprop.h:123:40: note: expected 'character *' {aka 'unsigned char *'} but argument is of type 'char *'
  123 | extern int utfencode _((unsigned long, character *));
      |                                        ^~~~~~~~~~~
_proto.h:24:14: note: in definition of macro '_'
   24 | #define _(x) x
      |              ^
compose.c: In function 'compose_three_patterns':
compose.c:558:27: warning: pointer targets in passing argument 2 of 'utfencode' differ in signedness [-Wpointer-sign]
  558 |   (void) utfencode (base, mnemo);
      |                           ^~~~~
      |                           |
      |                           char *
charprop.h:123:40: note: expected 'character *' {aka 'unsigned char *'} but argument is of type 'char *'
  123 | extern int utfencode _((unsigned long, character *));
      |                                        ^~~~~~~~~~~
_proto.h:24:14: note: in definition of macro '_'
   24 | #define _(x) x
      |              ^
compose.c: In function 'compose_base_patterns':
compose.c:677:46: warning: pointer targets in passing argument 2 of 'utfencode' differ in signedness [-Wpointer-sign]
  677 |                 mnemopoi += utfencode (base, mnemopoi);
      |                                              ^~~~~~~~
      |                                              |
      |                                              char *
charprop.h:123:40: note: expected 'character *' {aka 'unsigned char *'} but argument is of type 'char *'
  123 | extern int utfencode _((unsigned long, character *));
      |                                        ^~~~~~~~~~~
_proto.h:24:14: note: in definition of macro '_'
   24 | #define _(x) x
      |              ^
compose.c:692:54: warning: pointer targets in passing argument 2 of 'utfencode' differ in signedness [-Wpointer-sign]
  692 |                         mnemopoi += utfencode (base, mnemopoi);
      |                                                      ^~~~~~~~
      |                                                      |
      |                                                      char *
charprop.h:123:40: note: expected 'character *' {aka 'unsigned char *'} but argument is of type 'char *'
  123 | extern int utfencode _((unsigned long, character *));
      |                                        ^~~~~~~~~~~
_proto.h:24:14: note: in definition of macro '_'
   24 | #define _(x) x
      |              ^
compose.c:708:54: warning: pointer targets in passing argument 2 of 'utfencode' differ in signedness [-Wpointer-sign]
  708 |                         mnemopoi += utfencode (base, mnemopoi);
      |                                                      ^~~~~~~~
      |                                                      |
      |                                                      char *
charprop.h:123:40: note: expected 'character *' {aka 'unsigned char *'} but argument is of type 'char *'
  123 | extern int utfencode _((unsigned long, character *));
      |                                        ^~~~~~~~~~~
_proto.h:24:14: note: in definition of macro '_'
   24 | #define _(x) x
      |              ^
ar: creating ../bin/Linux.x86_64/charmaps.a
/usr/bin/ld: ../bin/Linux.x86_64/mined1.o: relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: failed to set dynamic section sizes: bad value
collect2: error: ld returned 1 exit status
gmake[1]: *** [mkinclud.mak:641: ../bin/Linux.x86_64/mined] Error 1
make: *** [makefile:9: mined] Error 2
@fantomfp
Copy link
Author

I will try with a latest git snapshot.

@mined
Copy link
Owner

mined commented Jan 31, 2023

I don't know why you added so many parameters to the make command but I'm certainly willing to check any additional warnings (although my priority is to get rid of the bothersome sprintf-related warnings in the default build).
Starting with dispatch.c (first warning above), I ran your make command without the two -specs parameters (because I do not have those files) and it compiles fine, without warning.

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

No branches or pull requests

2 participants