Re: ld linker with option -m elf_i386 stopped working in new version of cygwin.
Thank you so much, Brian for your response! I will try everthing you suggested. Em dom, 10 de out de 2021 15:54, Brian Inglis < brian.ing...@systematicsw.ab.ca> escreveu: > On 2021-10-10 09:17, Ronaldo Luiz Alonso via Cygwin wrote: > > Hello everybody! > > I am a professor teaching operational system and using a tutorial in > > french by michelizza: > > https://michelizza.developpez.com/realiser-son-propre-systeme/ > > In order to build the system and debug it in bochs I use the > > following Makefile: > > > > OBJ=kernel > > CC=gcc -Wall *-m32* -g > > > > all: $(OBJ) > > > > kernel: kernel.o screen.o lib.o gdt.o idt.o interrupt.o int.o pic.o > > syscalls.o mm.o printk.o process.o schedule.o sched.o > > * ld --oformat binary -m elf_i386 -Ttext 1000 $^ -o $@* > > > > int.o: int.asm > > nasm -f elf -o $@ $^ > > > > sched.o: sched.asm > > nasm -f elf -o $@ $^ > > > > .o: .c > > $(CC) -c $^ > > > > clean: > > rm -f $(OBJ) *.o > > > > Note that the system is compiled using -m 32 (system is for machines with > > 32 bits) bits and the linker uses elf_i386 multiboot format. > > > > This was working fine few weeks later, but when I run setup again to > update > > cygwin it stops working and ld complains that* this emulation mode is no > > longer supported! * > > The system now only links and builds PE windows executables! > > > > The question is: > > *how can I get and build an older version of ld source, so that this > works > > again in cygwin ?* > > *Is it possible?* > > *or should I give up developping this kernel using windows and cygwin and > > turn back to Linux?* > > $ ld --help | egrep 'elf|386' > ld: supported targets: pe-x86-64 pei-x86-64 pe-bigobj-x86-64 > elf64-x86-64 elf64-l1om elf64-k1om pe-i386 pei-i386 elf32-i386 > elf32-iamcu elf64-little elf64-big elf32-little elf32-big srec > symbolsrec verilog tekhex binary ihex plugin > ld: supported emulations: i386pep i386pe > i386pep: > i386pe: > > Package binutils ld still supports elf32-i386 but not emulation. > > For now you can still roll back to 2.36 and see if that supports the > target and emulation you are using; you may also have to roll back its > dependencies: > > depends2: cygwin, libintl8, zlib0 > > You can also still download the earlier Cygwin source package and > maintain that as an effective fork. > Older source package build control script definitions and patches are > available under: > > https://cygwin.com/git-cygwin-packages/?p=git/cygwin-packages/binutils.git > > and you may need earlier releases of build tools: > > build-depends: cygport, dejagnu, libgmp-devel, libiconv-devel, > libintl-devel, libisl-devel, libmpc-devel, libmpfr-devel, zlib-devel > > Older Cygwin Setup and package releases remain available at the Cygwin > Time Machine: > > http://www.crouchingtigerhiddenfruitbat.org/Cygwin/timemachine.html > > As Cygwin is a rolling release system, you need to pay attention to > announcement notices of test and stable releases of packages on which > your work depends. > New bug fix releases can quickly roll somewhat older releases out of the > available archives. > > -- > Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada > > This email may be disturbing to some readers as it contains > too much technical detail. Reader discretion is advised. > [Data in binary units and prefixes, physical quantities in SI.] > -- Problem reports: https://cygwin.com/problems.html FAQ: https://cygwin.com/faq/ Documentation:https://cygwin.com/docs.html Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple
[ANNOUNCEMENT] Updated: Perl distributions
The following Perl distributions have been updated to their latest release version available on CPAN: x86/x86_64 -- perl-Scalar-List-Utils-1.60-1 -- *** CYGWIN-ANNOUNCE UNSUBSCRIBE INFO *** If you want to unsubscribe from the cygwin-announce mailing list, look at the "List-Unsubscribe: " tag in the email header of this message. Send email to the address specified there. It will be in the format: cygwin-announce-unsubscribe-you=yourdomain@cygwin.com If you need more information on unsubscribing, start reading here: http://sourceware.org/lists.html#unsubscribe-simple Please read *all* of the information on unsubscribing that is available starting at this URL. -- Problem reports: https://cygwin.com/problems.html FAQ: https://cygwin.com/faq/ Documentation:https://cygwin.com/docs.html Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple
Updated: Perl distributions
The following Perl distributions have been updated to their latest release version available on CPAN: x86/x86_64 -- perl-Scalar-List-Utils-1.60-1 -- *** CYGWIN-ANNOUNCE UNSUBSCRIBE INFO *** If you want to unsubscribe from the cygwin-announce mailing list, look at the "List-Unsubscribe: " tag in the email header of this message. Send email to the address specified there. It will be in the format: cygwin-announce-unsubscribe-you=yourdomain@cygwin.com If you need more information on unsubscribing, start reading here: http://sourceware.org/lists.html#unsubscribe-simple Please read *all* of the information on unsubscribing that is available starting at this URL.
Re: ld linker with option -m elf_i386 stopped working in new version of cygwin.
On 2021-10-10 09:17, Ronaldo Luiz Alonso via Cygwin wrote: Hello everybody! I am a professor teaching operational system and using a tutorial in french by michelizza: https://michelizza.developpez.com/realiser-son-propre-systeme/ In order to build the system and debug it in bochs I use the following Makefile: OBJ=kernel CC=gcc -Wall *-m32* -g all: $(OBJ) kernel: kernel.o screen.o lib.o gdt.o idt.o interrupt.o int.o pic.o syscalls.o mm.o printk.o process.o schedule.o sched.o * ld --oformat binary -m elf_i386 -Ttext 1000 $^ -o $@* int.o: int.asm nasm -f elf -o $@ $^ sched.o: sched.asm nasm -f elf -o $@ $^ .o: .c $(CC) -c $^ clean: rm -f $(OBJ) *.o Note that the system is compiled using -m 32 (system is for machines with 32 bits) bits and the linker uses elf_i386 multiboot format. This was working fine few weeks later, but when I run setup again to update cygwin it stops working and ld complains that* this emulation mode is no longer supported! * The system now only links and builds PE windows executables! The question is: *how can I get and build an older version of ld source, so that this works again in cygwin ?* *Is it possible?* *or should I give up developping this kernel using windows and cygwin and turn back to Linux?* $ ld --help | egrep 'elf|386' ld: supported targets: pe-x86-64 pei-x86-64 pe-bigobj-x86-64 elf64-x86-64 elf64-l1om elf64-k1om pe-i386 pei-i386 elf32-i386 elf32-iamcu elf64-little elf64-big elf32-little elf32-big srec symbolsrec verilog tekhex binary ihex plugin ld: supported emulations: i386pep i386pe i386pep: i386pe: Package binutils ld still supports elf32-i386 but not emulation. For now you can still roll back to 2.36 and see if that supports the target and emulation you are using; you may also have to roll back its dependencies: depends2: cygwin, libintl8, zlib0 You can also still download the earlier Cygwin source package and maintain that as an effective fork. Older source package build control script definitions and patches are available under: https://cygwin.com/git-cygwin-packages/?p=git/cygwin-packages/binutils.git and you may need earlier releases of build tools: build-depends: cygport, dejagnu, libgmp-devel, libiconv-devel, libintl-devel, libisl-devel, libmpc-devel, libmpfr-devel, zlib-devel Older Cygwin Setup and package releases remain available at the Cygwin Time Machine: http://www.crouchingtigerhiddenfruitbat.org/Cygwin/timemachine.html As Cygwin is a rolling release system, you need to pay attention to announcement notices of test and stable releases of packages on which your work depends. New bug fix releases can quickly roll somewhat older releases out of the available archives. -- Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada This email may be disturbing to some readers as it contains too much technical detail. Reader discretion is advised. [Data in binary units and prefixes, physical quantities in SI.] -- Problem reports: https://cygwin.com/problems.html FAQ: https://cygwin.com/faq/ Documentation:https://cygwin.com/docs.html Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple
ld linker with option -m elf_i386 stopped working in new version of cygwin.
Hello everybody! I am a professor teaching operational system and using a tutorial in french by michelizza: https://michelizza.developpez.com/realiser-son-propre-systeme/ In order to build the system and debug it in bochs I use the following Makefile: OBJ=kernel CC=gcc -Wall *-m32* -g all: $(OBJ) kernel: kernel.o screen.o lib.o gdt.o idt.o interrupt.o int.o pic.o syscalls.o mm.o printk.o process.o schedule.o sched.o * ld --oformat binary -m elf_i386 -Ttext 1000 $^ -o $@* int.o: int.asm nasm -f elf -o $@ $^ sched.o: sched.asm nasm -f elf -o $@ $^ .o: .c $(CC) -c $^ clean: rm -f $(OBJ) *.o Note that the system is compiled using -m 32 (system is for machines with 32 bits) bits and the linker uses elf_i386 multiboot format. This was working fine few weeks later, but when I run setup again to update cygwin it stops working and ld complains that* this emulation mode is no longer supported! * The system now only links and builds PE windows executables! The question is: *how can I get and build an older version of ld source, so that this works again in cygwin ?* *Is it possible?* *or should I give up developping this kernel using windows and cygwin and turn back to Linux?* Thanks in advance. Ronaldo Alonso - Computer Engeneer and professor Federal University of Mato Grosso Brazil. -- Problem reports: https://cygwin.com/problems.html FAQ: https://cygwin.com/faq/ Documentation:https://cygwin.com/docs.html Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple
Re: [PATCH] Cygwin: pty: Fix handle leak regarding attach_mutex.
On 10/9/2021 8:49 PM, Takashi Yano wrote: - If the process having master pty opened is forked, attach_mutex fails to be closed when master is closed. This patch fixes the issue. --- winsup/cygwin/fhandler_console.cc | 2 +- winsup/cygwin/fhandler_tty.cc | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/winsup/cygwin/fhandler_console.cc b/winsup/cygwin/fhandler_console.cc index ee862b17d..aee5e8284 100644 --- a/winsup/cygwin/fhandler_console.cc +++ b/winsup/cygwin/fhandler_console.cc @@ -57,7 +57,7 @@ fhandler_console::console_state NO_COPY *fhandler_console::shared_console_info; bool NO_COPY fhandler_console::invisible_console; /* Mutex for AttachConsole()/FreeConsole() in fhandler_tty.cc */ -HANDLE NO_COPY attach_mutex; +HANDLE attach_mutex; static inline void acquire_attach_mutex (DWORD t) diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc index 823dabf73..f523dafed 100644 --- a/winsup/cygwin/fhandler_tty.cc +++ b/winsup/cygwin/fhandler_tty.cc @@ -57,7 +57,7 @@ struct pipe_reply { }; extern HANDLE attach_mutex; /* Defined in fhandler_console.cc */ -static LONG NO_COPY master_cnt = 0; +static LONG master_cnt = 0; inline static bool pcon_pid_alive (DWORD pid); @@ -2042,10 +2042,10 @@ fhandler_pty_master::close () } release_output_mutex (); master_fwd_thread->terminate_thread (); - if (InterlockedDecrement (_cnt) == 0) - CloseHandle (attach_mutex); } } + if (InterlockedDecrement (_cnt) == 0) +CloseHandle (attach_mutex); /* Check if the last master handle has been closed. If so, set input_available_event to wake up potentially waiting slaves. */ Pushed. Thanks. Ken